uncommented some code that was not intended to keep commented
This commit is contained in:
parent
f0e64a26da
commit
09a6b129a0
2 changed files with 21 additions and 24 deletions
9
main.py
9
main.py
|
@ -47,6 +47,7 @@ def addTask(bot, update, args):
|
|||
chat = Chat(tchat.id, title)
|
||||
else:
|
||||
chat = chats[ident]
|
||||
try:
|
||||
# Args: name repeat hour day/month/year
|
||||
if len(args) > 2:
|
||||
args[2] = args[2].strip('h')
|
||||
|
@ -63,14 +64,10 @@ def addTask(bot, update, args):
|
|||
else:
|
||||
t = chat.addTask(args[0])
|
||||
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')
|
||||
except Exception as e:
|
||||
except Exception as e:
|
||||
update.message.reply_text('Wrong format. Send /help for more details')
|
||||
"""
|
||||
|
||||
# except:
|
||||
# update.message.reply_text('Wrong format')
|
||||
|
|
2
task.py
2
task.py
|
@ -45,7 +45,7 @@ class Task(object):
|
|||
def __str__(self):
|
||||
s = "Task " + self.name + ":\n"
|
||||
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:
|
||||
s += "Repeats every " + str(self.repeat) + " days."
|
||||
return s
|
||||
|
|
Loading…
Reference in a new issue