diff --git a/app.py b/app.py index ccf2290..e922c72 100644 --- a/app.py +++ b/app.py @@ -34,7 +34,7 @@ class LearnApp(object): self.online = {} # build dependency graph - self.build_dependency_graph(conffile) # FIXME + self.build_dependency_graph(conffile) # connect to database and check registered students self.db_setup(self.depgraph.graph['database']) # FIXME @@ -167,6 +167,7 @@ class LearnApp(object): # ------------------------------------------------------------------------ # Receives a set of topics (strings like "math/algebra"), # and recursively adds dependencies to the dependency graph + # ------------------------------------------------------------------------ def build_dependency_graph(self, config_file): # Load configuration file diff --git a/serve.py b/serve.py index e992315..e211473 100755 --- a/serve.py +++ b/serve.py @@ -35,21 +35,21 @@ from tools import load_yaml, md class WebApplication(tornado.web.Application): def __init__(self, learnapp, debug=False): handlers = [ - (r'/login', LoginHandler), - (r'/logout', LogoutHandler), + (r'/login', LoginHandler), + (r'/logout', LogoutHandler), (r'/change_password', ChangePasswordHandler), - (r'/question', QuestionHandler), - (r'/', LearnHandler), - (r'/(.+)', FileHandler), + (r'/question', QuestionHandler), + (r'/', LearnHandler), + (r'/(.+)', FileHandler), ] settings = { 'template_path': os.path.join(os.path.dirname(__file__), 'templates'), 'static_path': os.path.join(os.path.dirname(__file__), 'static'), - 'static_url_prefix': '/static/', # this is the default + 'static_url_prefix': '/static/', 'xsrf_cookies': False, # FIXME see how to do it... 'cookie_secret': base64.b64encode(uuid.uuid4().bytes), 'login_url': '/login', - 'debug': True, + 'debug': debug, } super().__init__(handlers, **settings) self.learn = learnapp @@ -147,14 +147,17 @@ class QuestionHandler(BaseHandler): 'radio': 'question-radio.html', 'text': 'question-text.html', 'text_regex': 'question-text.html', + 'text-regex': 'question-text.html', 'text_numeric': 'question-text.html', + 'text-numeric': 'question-text.html', 'textarea': 'question-textarea.html', # -- information panels -- 'information': 'question-information.html', 'info': 'question-information.html', 'success': 'question-success.html', - # 'warning': '', FIXME - # 'alert': '', FIXME + # 'warning': '', FIXME + # 'warn': '', FIXME + # 'alert': '', FIXME } @tornado.web.authenticated @@ -203,7 +206,7 @@ def main(): argparser.add_argument('conffile', type=str, nargs='+', help='Topics configuration file in YAML format.') # FIXME only one argparser.add_argument('--debug', action='store_true', - help='Enable debug logging.') # FIXME not implemented + help='Enable webserver debug (not debug logging).') arg = argparser.parse_args() # --- Setup logging -- libgit2 0.21.2