diff options
author | Fabian Affolter <fabian@bernewireless.net> | 2010-06-08 08:16:41 +0000 |
---|---|---|
committer | Sol Jerome <solj@ices.utexas.edu> | 2010-06-09 08:09:54 -0500 |
commit | a2755d2d1a111ad4e55f88a166a5b02856d363cd (patch) | |
tree | 82dabe1dbbe429e9d5cbe554ffb16702a79041d2 /src/lib/Server/Plugins/Statistics.py | |
parent | e31f5234256e5234348fc67cf45e6f3462e1fbb8 (diff) | |
download | bcfg2-a2755d2d1a111ad4e55f88a166a5b02856d363cd.tar.gz bcfg2-a2755d2d1a111ad4e55f88a166a5b02856d363cd.tar.bz2 bcfg2-a2755d2d1a111ad4e55f88a166a5b02856d363cd.zip |
Updated files to match PEP 257
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5904 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Server/Plugins/Statistics.py')
-rw-r--r-- | src/lib/Server/Plugins/Statistics.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/Server/Plugins/Statistics.py b/src/lib/Server/Plugins/Statistics.py index 74e676243..c7fa0e534 100644 --- a/src/lib/Server/Plugins/Statistics.py +++ b/src/lib/Server/Plugins/Statistics.py @@ -16,7 +16,7 @@ import Bcfg2.Server.Plugin class StatisticsStore(object): - '''Manages the memory and file copy of statistics collected about client runs''' + """Manages the memory and file copy of statistics collected about client runs.""" __min_write_delay__ = 0 def __init__(self, filename): @@ -28,7 +28,7 @@ class StatisticsStore(object): self.ReadFromFile() def WriteBack(self, force=0): - '''Write statistics changes back to persistent store''' + """Write statistics changes back to persistent store.""" if (self.dirty and (self.lastwrite + self.__min_write_delay__ <= time())) \ or force: try: @@ -43,7 +43,7 @@ class StatisticsStore(object): self.lastwrite = time() def ReadFromFile(self): - '''Reads current state regarding statistics''' + """Reads current state regarding statistics.""" try: fin = open(self.filename, 'r') data = fin.read() @@ -57,7 +57,7 @@ class StatisticsStore(object): self.dirty = 0 def updateStats(self, xml, client): - '''Updates the statistics of a current node with new data''' + """Updates the statistics of a current node with new data.""" # Current policy: # - Keep anything less than 24 hours old @@ -105,7 +105,7 @@ class StatisticsStore(object): self.WriteBack(force=1) def isOlderThan24h(self, testTime): - '''Helper function to determine if <time> string is older than 24 hours''' + """Helper function to determine if <time> string is older than 24 hours.""" now = time() utime = mktime(strptime(testTime)) secondsPerDay = 60*60*24 |