fixed datetime error

remotes/1705286528371406548/stable1
b3yond 2017-07-20 22:44:44 +02:00
parent a2c635cbf6
commit b3fa55104c
4 changed files with 4 additions and 5 deletions

1
.gitignore vendored
View File

@ -9,4 +9,3 @@ pip-selfcheck.json
bin/
include/
lib/
logs/*

View File

@ -27,7 +27,7 @@ class RetootBot(object):
if logpath:
self.logpath = logpath
else:
self.logpath = os.path.join("logs", "{%Y-%m-%d_%H:%M:%S}".format(datetime.datetime.now()))
self.logpath = os.path.join("logs", str(datetime.datetime.now()))
def log(self, message, tb=False):
"""
@ -36,7 +36,7 @@ class RetootBot(object):
:param message(string): Log message to be displayed
:param tb: String of the Traceback
"""
time = "{%Y-%m-%d_%H:%M:%S}".format(datetime.datetime.now())
time = str(datetime.datetime.now())
if tb:
message = message + " The traceback is located at " + os.path.join("logs" + time)
with open(os.path.join("logs", time), 'w+') as f:

View File

@ -80,7 +80,7 @@ class RetweetBot(object):
:param message(string): Log message to be displayed
:param tb: String of the Traceback
"""
time = "{%Y-%m-%d_%H:%M:%S}".format(datetime.datetime.now())
time = str(datetime.datetime.now())
if tb:
message = message + " The traceback is located at " + os.path.join("logs" + time)
with open(os.path.join("logs", time), 'w+') as f:

View File

@ -18,7 +18,7 @@ if __name__ == '__main__':
trigger = Trigger(config)
logpath = os.path.join("logs", "{%Y-%m-%d_%H:%M:%S}".format(datetime.datetime.now()))
logpath = os.path.join("logs", str(datetime.datetime.now()))
mbot = RetootBot(config, trigger, logpath=logpath)
tbot = RetweetBot(trigger, config, logpath=logpath)