Package elisa :: Package core :: Package utils :: Module update_checker :: Class UpdateChecker

Class UpdateChecker

source code


Helper Class for simple look up of updates on the remote elisa server.

Instance Methods
 
__init__(self, install_date, user_id, version, **extra_affiliation_params)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
dict
parse_result(self, result)
Parse the given data into a dictionary.
source code
 
request(self)
Request for update data and parse it
source code
 
start(self, callback)
Sets up an automatic loop of update url calls starting right now.
source code
 
stop(self)
Stop any pending loop or http calls
source code

Inherited from extern.log.log.Loggable: debug, doLog, error, info, log, logFunction, logObjectName, warning, warningFailure

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

Class Variables
  check_interval = 86400

Inherited from extern.log.log.Loggable: logCategory

Properties

Inherited from object: __class__

Method Details

__init__(self, install_date, user_id, version, **extra_affiliation_params)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

parse_result(self, result)

source code 

Parse the given data into a dictionary. The syntax for result has to be a key-value pair per line separated by a colon (':'). Spaces at the beginning or the end are stripped from both the key and the value. For instance:

   foo: bar
   test: partial
   maybe : maybe not
Parameters:
  • result (str) - the result to parse
Returns: dict
a dictionary containing the key-value pairs

start(self, callback)

source code 

Sets up an automatic loop of update url calls starting right now. Everytime a result is received the callback is triggered with a dictionary of the parsed result as argument. The next iteration is done every check_interval-seconds.

Raises:
  • AlreadyRunning - if the method was already called before. It is only allowed to call this method once. It is mandatory to call stop before calling start again.