Admin-only command to upload plugins to hastebin

This commit is contained in:
Steven Smith 2013-09-08 13:03:11 +08:00
parent d3d36891e7
commit 00368f59b0

12
plugins/plpaste.py Normal file
View file

@ -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)"