aboutsummaryrefslogtreecommitdiffstats
path: root/libpathod/app.py
diff options
context:
space:
mode:
Diffstat (limited to 'libpathod/app.py')
-rw-r--r--libpathod/app.py37
1 files changed, 10 insertions, 27 deletions
diff --git a/libpathod/app.py b/libpathod/app.py
index 95e7d169..1e65bc4f 100644
--- a/libpathod/app.py
+++ b/libpathod/app.py
@@ -9,37 +9,20 @@ def api_info():
)
-"""
-class APILog(tornado.web.RequestHandler):
- def get(self):
- self.write(
- dict(
- d = self.application.get_log()
- )
- )
-
-
-class APILogClear(tornado.web.RequestHandler):
- def post(self):
- self.application.clear_log()
- self.write("OK")
-
+@app.route('/api/log')
+def api_log():
+ return jsonify(
+ log = app.config["pathod"].get_log()
+ )
-class APIShutdown(tornado.web.RequestHandler):
- def post(self):
- tornado.ioloop.IOLoop.instance().stop()
- self.write("OK")
-
-class APIInfo(tornado.web.RequestHandler):
- def get(self):
- self.write(
- dict(
- version = version.IVERSION
- )
- )
+@app.route('/api/clear_log')
+def api_clear_log():
+ app.config["pathod"].clear_log()
+ return "OK"
+"""
class _Page(tornado.web.RequestHandler):
def render(self, name, **kwargs):
tornado.web.RequestHandler.render(self, name + ".html", **kwargs)