1 # Written by Njaal Borch
2 # see LICENSE.txt for license information
5 Status gathering module with some simple reporting functionality
9 status = Status.get_status_holder("somename") # Get status object
10 reporter = MyReporter("MyReporter") # Create the reporter
11 status.add_reporter(reporter) # Add the reporter to the status object
14 elem = status.create_status_element("ElementName",
17 elem.set_value(somevalue)
19 # The element will now be reported by the reporter.
21 A reporter can be created easily like this:
23 # Print name=value when the element is changed
24 class MyOnChangeStatusReporter(Status.OnChangeStatusReporter):
26 def report(self, element):
27 print element.name,"=",element.value
30 # Print name=value for all elements when the periodic reporter runs
31 class MyPeriodicStatusReporter(Status.PeriodicStatusReporter):
33 for elems in self.elements[:]:
34 print element.name,"=",element.value
37 See the StatusTest.py class for more examples
42 from LivingLabReporter import LivingLabPeriodicReporter