--- a/viewer.py Wed Aug 24 19:46:24 2016 +0800
+++ b/viewer.py Wed Aug 24 21:22:05 2016 +0800
from candolint.utils import rel
-define('listen', metavar='IP', default='127.0.0.1')
-define('port', metavar='PORT', default=8033, type=int)
-define('xheaders', metavar='True|False', default=False, type=bool)
-define('debug', metavar='True|False', default=False, type=bool)
class CandolintViewer(Application):
+ def __init__(self, debug=False):
project_re = r'/([.a-z0-9_-]+)/([^/]+)/([^/]+)'
static_path=rel('static'),
template_path=rel('templates'),
super(CandolintViewer, self).__init__(handlers, **settings)
logging.getLogger('peewee').setLevel(logging.DEBUG)
database.init(rel('database.sqlite'))
+ define('listen', metavar='IP', default='127.0.0.1')
+ define('port', metavar='PORT', default=8033, type=int)
+ define('xheaders', metavar='True|False', default=False, type=bool)
+ define('debug', metavar='True|False', default=False, type=bool)
options.parse_command_line()
- application = CandolintViewer()
+ application = CandolintViewer(options.debug)
application.listen(options.port, options.listen, xheaders=options.xheaders)