Changeset 24:cd794f1c6ff0 for src/logger.py
- Timestamp:
- 02/15/12 20:03:48 (13 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/logger.py
r21 r24 37 37 """Get the string representation of the given timestamp.""" 38 38 return time.strftime("%H:%M:%S", time.gmtime(timestamp)) 39 40 def reset(self): 41 """Reset the logger. 42 43 The faults logged so far will be cleared.""" 44 self._faults.clear() 39 45 40 46 def message(self, timestamp, msg): … … 58 64 s = Logger._stages[stage] if stage in Logger._stages else "<Unknown>" 59 65 self.message(timestamp, "--- %s ---" % (s,)) 66 if stage==const.STAGE_END: 67 totalScore = 100 68 for (id, score) in self._faults.iteritems(): 69 totalScore -= score 70 self.untimedMessage("Score: %.0f" % (totalScore,)) 60 71 61 72 def fault(self, faultID, timestamp, what, score):
Note:
See TracChangeset
for help on using the changeset viewer.