From a9df94a5ad0fc0ef4e7bfa11bbfe7db06947838f Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Tue, 12 Jun 2018 01:42:17 -0400 Subject: [PATCH] Temp logging of csvs to files --- doorUpdater.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doorUpdater.py b/doorUpdater.py index 0c682ab..c3ec4da 100755 --- a/doorUpdater.py +++ b/doorUpdater.py @@ -95,7 +95,10 @@ def makeDoor(doorName, doorData, members, hashes): if member is not None: writer.writerow(member) - print(outString.getvalue()) + import datetime as DT + timestamp = DT.datetime.now().strftime("%Y-%m-%d %H:%M:%S") + with open("/tmp/" + doorName + timestamp + ".csv", "w") as f: + f.write(outString.getvalue()) outString.seek(0) doorHash = md5(bytes(outString.getvalue(), 'utf8')).hexdigest()