Package bosco :: Module ranking :: Class TimeScoreing
[hide private]
[frames] | no frames]

Class TimeScoreing

source code

   object --+        
            |        
CachingObject --+    
                |    
 AbstractScoreing --+
                    |
                   TimeScoreing

Builds the score from difference of start and finish times. The start time is calculated by the start time strategy object. The finish time is the time of the finish punch. Subclasses can override _start and _finish the extract the start and finsh times in other ways.

Instance Methods [hide private]
 
__init__(self, starttime_strategy, cache=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
_start(self, obj)
Returns the start time as a datetime object.
source code
 
score(self, obj)
Returns a timedelta object as the score by calling start and finish on the object.
source code

Inherited from CachingObject (private): _from_cache, _to_cache

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

Class Variables [hide private]

Inherited from AbstractScoreing: information

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, starttime_strategy, cache=None)
(Constructor)

source code 

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

Parameters:
  • start_time_strategy (object of class StartTimeStrategy or a subclass) - Strategy to find the start time
Overrides: object.__init__

score(self, obj)

source code 

Returns a timedelta object as the score by calling start and finish on the object.

Overrides: AbstractScoreing.score