From 00368f59b026f62fafb929d588a564e15d591ecb Mon Sep 17 00:00:00 2001 From: Steven Smith Date: Sun, 8 Sep 2013 13:03:11 +0800 Subject: [PATCH] Admin-only command to upload plugins to hastebin --- plugins/plpaste.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 plugins/plpaste.py diff --git a/plugins/plpaste.py b/plugins/plpaste.py new file mode 100644 index 0000000..238037d --- /dev/null +++ b/plugins/plpaste.py @@ -0,0 +1,12 @@ +from util import hook, web + + +@hook.command(adminonly=True) +def plpaste(inp): + if "/" in inp and inp.split("/")[0] != "util": + return "Invalid input" + try: + with open("plugins/%s.py" % inp) as f: + return web.haste(f.read(), ext='py') + except IOError: + return "Plugin not found (must be in plugins folder)"