From 3365acf69fcc269c52dac405f674cc094faeb64c Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Mon, 30 Apr 2012 09:54:49 +1200 Subject: Clear log API. --- libpathod/app.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libpathod') diff --git a/libpathod/app.py b/libpathod/app.py index 7059f9ba..ca24c62c 100644 --- a/libpathod/app.py +++ b/libpathod/app.py @@ -12,6 +12,12 @@ class APILog(tornado.web.RequestHandler): ) +class APILogClear(tornado.web.RequestHandler): + def post(self): + self.application.clear_log() + self.write("OK") + + class _Page(tornado.web.RequestHandler): def render(self, name, **kwargs): tornado.web.RequestHandler.render(self, name + ".html", **kwargs) @@ -129,6 +135,7 @@ class PathodApp(tornado.web.Application): (r"/help", Help), (r"/preview", Preview), (r"/api/log", APILog), + (r"/api/log/clear", APILogClear), (r"/p/.*", RequestPathod, settings), ], static_path = utils.data.path("static"), -- cgit v1.2.3