uncommented some code that was not intended to keep commented

This commit is contained in:
vylion 2017-10-15 11:36:07 +02:00
parent f0e64a26da
commit 09a6b129a0
2 changed files with 21 additions and 24 deletions

View file

@ -47,6 +47,7 @@ def addTask(bot, update, args):
chat = Chat(tchat.id, title) chat = Chat(tchat.id, title)
else: else:
chat = chats[ident] chat = chats[ident]
try:
# Args: name repeat hour day/month/year # Args: name repeat hour day/month/year
if len(args) > 2: if len(args) > 2:
args[2] = args[2].strip('h') args[2] = args[2].strip('h')
@ -63,14 +64,10 @@ def addTask(bot, update, args):
else: else:
t = chat.addTask(args[0]) t = chat.addTask(args[0])
update.message.reply_text('Task ' + t.name + ' added') update.message.reply_text('Task ' + t.name + ' added')
chats[ident] = chat
"""
except ValueError as ve: except ValueError as ve:
update.message.reply_text('A task already exists under this name') update.message.reply_text('A task already exists under this name')
except Exception as e: except Exception as e:
update.message.reply_text('Wrong format. Send /help for more details') update.message.reply_text('Wrong format. Send /help for more details')
"""
# except: # except:
# update.message.reply_text('Wrong format') # update.message.reply_text('Wrong format')

View file

@ -45,7 +45,7 @@ class Task(object):
def __str__(self): def __str__(self):
s = "Task " + self.name + ":\n" s = "Task " + self.name + ":\n"
s += "Date: " + " " + str(self.date.day) + "/" + str(self.date.month) + "/" + str(self.date.year) s += "Date: " + " " + str(self.date.day) + "/" + str(self.date.month) + "/" + str(self.date.year)
s += " at " + str(self.date.hour) + ":00\n" s += " at " + str(self.date.hour) + "h\n"
if self.repeat > 0: if self.repeat > 0:
s += "Repeats every " + str(self.repeat) + " days." s += "Repeats every " + str(self.repeat) + " days."
return s return s