fix small errors

This commit is contained in:
root
2017-07-26 02:08:21 +02:00
parent d4f18a504b
commit 2a03b0a359
4 changed files with 55 additions and 48 deletions

View File

@@ -57,13 +57,16 @@ def reload():
return render_index("Commands in cmds.cfg reloaded")
@app.route("/<string:cmd>")
def cm(cmd):
if cmd in keys:
@app.route("/<string:k>")
def cm(k):
if k in keys:
if "vers" in cfg and cfg.vers == 2:
c=cmds[cmd].cmd
if "cmd" in cmds[k] and cmds[k]:
c=cmds[k]["cmd"]
else:
c=cmds[k]
else:
c=cmds[cmd]
c=cmds[k]
return run_cmd(c)
else:
return render_template("index.html", out="Command not found", cmds=cmds, keys=keys, title=cfg.title.decode("utf8"), vers=cfg.vers), 404
return render_index("Command not found", 404)