Package duplicity :: Module statistics :: Class StatsObj
[hide private]
[frames] | no frames]

Class StatsObj

source code

Contains various statistics, provide string conversion functions

Instance Methods [hide private]
 
__init__(self)
Set attributes to None
source code
 
get_stat(self, attribute)
Get a statistic
source code
 
set_stat(self, attr, value)
Set attribute to given value
source code
 
increment_stat(self, attr)
Add 1 to value of attribute
source code
 
get_total_dest_size_change(self)
Return total destination size change
source code
 
get_stats_line(self, index, use_repr=1)
Return one line abbreviated version of full stats string
source code
 
set_stats_from_line(self, line)
Set statistics from given line
source code
 
get_stats_string(self)
Return extended string printing out statistics
source code
 
get_timestats_string(self)
Return portion of statistics string dealing with time
source code
 
get_filestats_string(self)
Return portion of statistics string about files and bytes
source code
 
get_miscstats_string(self)
Return portion of extended stat string about misc attributes
source code
 
get_byte_summary_string(self, byte_count)
Turn byte count into human readable string like "7.23GB"
source code
 
get_stats_logstring(self, title)
Like get_stats_string, but add header and footer
source code
 
set_stats_from_string(self, s)
Initialize attributes from string, return self for convenience
source code
 
write_stats_to_path(self, path)
Write statistics string to given path
source code
 
read_stats_from_path(self, path)
Set statistics from path, return self for convenience
source code
 
stats_equal(self, s)
Return true if s has same statistics as self
source code
 
set_to_average(self, statobj_list)
Set self's attributes to average of those in statobj_list
source code
 
get_statsobj_copy(self)
Return new StatsObj object with same stats as self
source code
Class Variables [hide private]
  space_regex = re.compile(" ")
  stat_file_attrs = 'SourceFiles', 'SourceFileSize', 'NewFiles',...
  stat_misc_attrs = 'Errors', 'TotalDestinationSizeChange'
  stat_time_attrs = 'StartTime', 'EndTime', 'ElapsedTime'
  stat_attrs = 'Filename',+ stat_time_attrs+ stat_misc_attrs+ st...
  stat_file_pairs = 'SourceFiles', False, ('SourceFileSize', Tru...
  byte_abbrev_list = 1024* 1024* 1024* 1024, "TB", (1024* 1024* ...
Method Details [hide private]

get_total_dest_size_change(self)

source code 

Return total destination size change

This represents the total increase in the size of the duplicity destination directory, or None if not available.


Class Variable Details [hide private]

stat_file_attrs

Value:
'SourceFiles', 'SourceFileSize', 'NewFiles', 'NewFileSize', 'DeletedFi\
les', 'ChangedFiles', 'ChangedFileSize', 'ChangedDeltaSize', 'DeltaEnt\
ries', 'RawDeltaSize'

stat_attrs

Value:
'Filename',+ stat_time_attrs+ stat_misc_attrs+ stat_file_attrs

stat_file_pairs

Value:
'SourceFiles', False, ('SourceFileSize', True), ('NewFiles', False), (\
'NewFileSize', True), ('DeletedFiles', False), ('ChangedFiles', False)\
, ('ChangedFileSize', True), ('ChangedDeltaSize', True), ('DeltaEntrie\
s', False), ('RawDeltaSize', True)

byte_abbrev_list

Value:
1024* 1024* 1024* 1024, "TB", (1024* 1024* 1024, "GB"), (1024* 1024, "\
MB"), (1024, "KB")