We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 86ad10a commit f79a6d8Copy full SHA for f79a6d8
preditor/debug.py
@@ -21,11 +21,15 @@ def clear(self, stamp=False):
21
"""Removes the contents of the log file."""
22
open(self._logfile, 'w').close()
23
if stamp:
24
- msg = '--------- Date: {today} Version: {version} ---------'
25
- print(msg.format(today=datetime.datetime.today(), version=sys.version))
+ print(self.stamp())
26
27
def flush(self):
28
- self._stdhandle.flush()
+ if self._stdhandle:
+ self._stdhandle.flush()
29
+
30
+ def stamp(self):
31
+ msg = '--------- Date: {today} Version: {version} ---------'
32
+ return msg.format(today=datetime.datetime.today(), version=sys.version)
33
34
def write(self, msg):
35
f = open(self._logfile, 'a')
0 commit comments