Skip to content
This repository was archived by the owner on Sep 29, 2023. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ The function calls are converted to appropriate values and mapped to their librr
]

def my_callback(filename, cf, start, end, step):
itemcount = (end - start) / step
itemcount = math.ceil((end - start) / step)
return {
'start': start,
'step': 300,
Expand All @@ -265,8 +265,8 @@ The function calls are converted to appropriate values and mapped to their librr
}
}

rrdtool.register_fetch_cb(my_callable)
rrdtool.graphv(**graphv_args)
rrdtool.register_fetch_cb(my_callback)
rrdtool.graphv(*graphv_args)

# also works with callable objects
class MyCallable(object):
Expand All @@ -276,7 +276,7 @@ The function calls are converted to appropriate values and mapped to their librr

cb = MyCallable()
rrdtool.register_fetch_cb(cb) # overwrite callback
rrdtool.graphv(**graphv_args)
rrdtool.graphv(*graphv_args)

.. note:: This function uses Python long integers on Python 2.x and 3.x to minimize compatibility code requirements (Python 3 has long integers as its default int anyway).

Expand Down Expand Up @@ -381,4 +381,4 @@ python-rrdtool will raise exceptions in the event of errors.

Raised in the event of errors generated by rrdtool itself.

Both exception classes are directly derived from the ``Exception`` class.
Both exception classes are directly derived from the ``Exception`` class.