Home | Trees | Indices | Help |
---|
|
Reporter.Reporter --+ | UsageReporter
Usage - Module for creating simple usage reports:
from inca.UsageReporter import UsageReporter reporter = new UsageReporter( name = 'My Reporter', version = 0.1, description = 'What my reporter does', url = 'http://some.where/' )
This module is a subclass of inca.Reporter that provides a simple schema for reporting usage data. The reporter will return the following body if the reporter is successful:
<usage> <entry> <type>type1</type> <name>foo</name> <statistics> <statistic> <name>count</name> <value>9</value> </statistic> </statistics> </entry> <entry> . . . </usage>
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from |
|
Class constructor that returns a new Usage object. The constructor accepts the parameters supported by inca.Reporter.
|
This method is used to add an entry to the usage report. It takes a dict containing the type and name of the entry as well as a dict of statistics. For example: addEntry({ 'type' : 'foo', 'name' : 'bar', 'stats' : { 'count' : 1, 'blort' : 'baz' } }) Will create an entry of type 'foo', with a name of 'bar' and two statistics, count with a value of 1 and 'blort' with a value of 'baz'. |
This method is used to indicate that the reporter failed. It takes a single arguement which is the error message which will be returned. |
Constructs the body and returns it.
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Fri Aug 21 14:47:15 2009 | http://epydoc.sourceforge.net |