timprove log redo - amprolla - devuan's apt repo merger (HTM) git clone git://parazyd.org/amprolla.git (DIR) Log (DIR) Files (DIR) Refs (DIR) README (DIR) LICENSE --- (DIR) commit 78478d1f634efb94105a68997428ab7ea840c2d0 (DIR) parent 8707f299e5393148e19d336d6f4a2a501c2e610c (HTM) Author: parazyd <parazyd@dyne.org> Date: Mon, 6 Nov 2017 12:46:00 +0100 improve log redo Diffstat: M lib/log.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- (DIR) diff --git a/lib/log.py b/lib/log.py t@@ -49,8 +49,9 @@ def logtofile(filename, text, redo=False): If redo is True, rewrites the file """ makedirs(logdir, exist_ok=True) + wrt = 'a' if redo: - remove(join(logdir, filename)) - lfile = open(join(logdir, filename), 'a') + wrt = 'w' + lfile = open(join(logdir, filename), wrt) lfile.write(text) lfile.close()