check - check status of a chore
done - mark a chore as done
list - print the chore list
+ filter TERM - list all chores that include TERM
undo - mark a chore as undone
'''
if match.command('list'):
- results = ['## Listing chores...']
+ results = ['## Listing all...']
for item in CHORES.list():
results.append(item)
results.append('-- End of List --')
return results
+
+ if match.command('filter'):
+ term = ' '.join(match.args()[1:])
+ results = [f'## List matching {term}']
+ for item in CHORES.filter(term):
+ results.append(item)
+ results.append('-- End of List --')
+ return results
if match.command('setup'):
results = []
results.append(Data.check_chore(session, chore.id))
return results
+ def filter(self, term):
+ results = []
+ for item in self.list():
+ if term in item:
+ results.append(item)
+
+ return results
+
+
+
+
def add(self, name):
try:
with Session(self.engine) as session: