monolith/legacy/commands/exec.py

22 lines
576 B
Python
Raw Permalink Normal View History

class ExecCommand:
def __init__(self, *args):
self.exec(*args)
2022-09-05 06:20:30 +00:00
def exec(
self, addr, authed, data, obj, spl, success, failure, info, incUsage, length
):
if authed:
if length > 1:
try:
rtrn = exec(" ".join(spl[1:]))
except Exception as err:
failure(str(err))
return
info(str(rtrn))
return
else:
incUsage("exec")
return
else:
incUsage(None)