Package buildxml :: Package xmlgetter :: Module stats :: Class Stats
[hide private]
[frames] | no frames]

Class Stats

source code


Stores and represents statistics about the update process.

This is a dict-like object, that can contain only other instances of Stats.

Instance Methods [hide private]
Stats
__init__(self, source=u'__main__')
Initialize instance variables.
source code
 
__setitem__(self, key, item)
Provided to produce dict-like behavior.
source code
 
addStats(self, stat_entry)
Add a instance of Stats to the internal dictionary using the source property as key.
source code
string
__str__(self)
Return a table representing the information in this instance and all Stats instances contained in the internal dictionary.
source code
timedelta
update_time_diff(self)
Returns: The timedelta for the two variables update_time_end and update_time_start.
source code

Inherited from dict: __cmp__, __contains__, __delitem__, __eq__, __ge__, __getattribute__, __getitem__, __gt__, __iter__, __le__, __len__, __lt__, __ne__, __new__, __repr__, __sizeof__, clear, copy, fromkeys, get, has_key, items, iteritems, iterkeys, itervalues, keys, pop, popitem, setdefault, update, values

Inherited from object: __delattr__, __format__, __reduce__, __reduce_ex__, __setattr__, __subclasshook__

Inherited from log.BaseLogger: logger

Inherited from log.BaseLogger (private): _getLogger

Class Variables [hide private]

Inherited from dict: __hash__

Inherited from log.BaseLogger (private): _loggers

Instance Variables [hide private]
string source = None
The sources name.
int entries = -1
Number of entries in total.
int new_entries = -1
Number of newly added entries since the last update.
int modified_entries = -1
Number of entries that hav been modified since the last update.
int unmodified_entries = -1
Number of unmodified entries.
int static_entries = -1
Number of static entries.
string status = None
A string denoting the status of the update process.
list messages = None
A list of messages added during the update process.
datetime update_time_start = None
The date and time of the start of the update process.
datetime update_time_end = None
The date and time of the end of the update process.

Inherited from log.BaseLogger (private): _source_name

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, source=u'__main__')
(Constructor)

source code 

Initialize instance variables.

Parameters:
Returns: Stats
New statistics instance initialized with 0, no messages and status 'ok'.
Overrides: log.BaseLogger.__init__

__setitem__(self, key, item)
(Index assignment operator)

source code 

Provided to produce dict-like behavior. All it does is logging a warning on DEBUG level, if someone tries to set a item.

Overrides: dict.__setitem__

addStats(self, stat_entry)

source code 

Add a instance of Stats to the internal dictionary using the source property as key. Abort if stat_entry is not an instance of Stats

Parameters:
  • stat_entry (Stats) - A Stats instance.

__str__(self)
(Informal representation operator)

source code 

Return a table representing the information in this instance and all Stats instances contained in the internal dictionary.

Returns: string
A table with the statistical information.
Overrides: object.__str__

update_time_diff(self)

source code 
Returns: timedelta
The timedelta for the two variables update_time_end and update_time_start.
Decorators:
  • @property

Instance Variable Details [hide private]

static_entries

Number of static entries. "Static" meaning entries that can not be send as a stub, because there is no modification timestamp.
Type:
int
Value:
-1

status

A string denoting the status of the update process. Currently it is set to u'ok' for success and u'FAILED' for a failed run. TODO update, finish implementation!
Type:
string
Value:
None

messages

A list of messages added during the update process. Can be used to notify the user about uncritical errors and warnings.
Type:
list
Value:
None