Package bosco :: Module observer :: Class EventObserver
[hide private]
[frames] | no frames]

Class EventObserver

source code

object --+
         |
        EventObserver

Observes an Event for new data (e.g. new punches).


Warning: This will rollback the store every <intervall> seconds!

Instance Methods [hide private]
 
_punch_notify(self, punch) source code
 
_run_notify(self, run) source code
 
_runner_notify(self, runner) source code
 
_team_notify(self, team) source code
 
_category_notify(self, category) source code
 
_course_notify(self, course) source code
 
__init__(self, store, interval=5, rollback=True)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
_start_timer(self) source code
 
stop(self) source code
 
register(self, obj, observable)
Register an object to be notified of changes of type event.
source code
 
unregister(self, obj, observable)
Unregister an object from this observer for this observable.
source code
 
observe(self)
Does the actual observation.
source code
 
_get_max(self, t) source code
 
_notify(self, observable)
Notifies objects of an event.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  _tables = [(Punch, _punch_notify),]
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, store, interval=5, rollback=True)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • interval - Check interval
  • rollback - Rollback store before checking for new objects? This is necessary to get new objects added by other connections but it resets all uncommited changes.
Overrides: object.__init__

register(self, obj, observable)

source code 

Register an object to be notified of changes of type event.

Parameters:
  • obj - The object to receive to notification. obj must have a update(self, event) method.
  • observable - object that should be observed for changes. Currently run, runner and team are supported