weather.py für ansiweather

This commit is contained in:
plocki 2020-01-30 21:54:59 +01:00
parent 80f125683f
commit bef686bd29
1 changed files with 30 additions and 0 deletions

30
modules/task.py Normal file
View File

@ -0,0 +1,30 @@
import subprocess
import os
class MatrixModule:
async def matrix_message(self, bot, room, event):
args = event.body.split()
args.pop(0)
encoding="utf-8"
forbidden_args = ['help', 'edit', 'command', 'stats', 'config', 'ghistory', 'burndown']
# wrap task
if not args:
args=['list']
if args[0] in forbidden_args:
print(args[0], "found in List: " , forbidden_args)
await bot.send_text(room, "command not allowed")
return()
result = subprocess.check_output(
["task",
"rc.confirmation:no",
"rc.verbose:list",
"rc.bulk:0",
"rc.recurrence.confirmation:yes"]
+ args, stderr=subprocess.DEVNULL)
await bot.send_text(room, result.decode(encoding))
def help(self):
return('taskwarrior')