From f8dd637971334c1b9cd34d0efd677f4239c69310 Mon Sep 17 00:00:00 2001 From: Miguel BarĂ£o Date: Sat, 13 May 2017 17:47:39 +0100 Subject: [PATCH] - minor corrections --- app.py | 2 +- questions.py | 9 ++++----- serve.py | 9 ++++++--- templates/question.html | 2 ++ 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/app.py b/app.py index 4a73149..ccf2290 100644 --- a/app.py +++ b/app.py @@ -172,7 +172,7 @@ class LearnApp(object): # Load configuration file try: with open(config_file, 'r') as f: - logger.info(f'Loading configuration file "{config_file}"') + logger.info(f'Configuration file "{config_file}"') config = yaml.load(f) except FileNotFoundError as e: logger.error(f'File not found: "{config_file}"') diff --git a/questions.py b/questions.py index 0a2c73c..46aed43 100644 --- a/questions.py +++ b/questions.py @@ -389,13 +389,12 @@ class QFactory(object): 'radio' : QuestionRadio, 'checkbox' : QuestionCheckbox, 'text' : QuestionText, - 'text_regex': QuestionTextRegex, - 'text_numeric': QuestionTextNumeric, + 'text_regex': QuestionTextRegex, 'text-regex': QuestionTextRegex, + 'text_numeric': QuestionTextNumeric, 'text-numeric': QuestionTextNumeric, 'textarea' : QuestionTextArea, # -- informative panels -- - 'information': QuestionInformation, - 'info' : QuestionInformation, # same as 'information' - 'warning' : QuestionInformation, + 'information': QuestionInformation, 'info': QuestionInformation, + 'warning' : QuestionInformation, 'warn': QuestionInformation, 'alert' : QuestionInformation, 'success' : QuestionInformation, } diff --git a/serve.py b/serve.py index d5fc6a0..e992315 100755 --- a/serve.py +++ b/serve.py @@ -114,7 +114,7 @@ class ChangePasswordHandler(BaseHandler): self.write({'msg': notification}) # ---------------------------------------------------------------------------- -# /learn +# /learn main page # ---------------------------------------------------------------------------- class LearnHandler(BaseHandler): @tornado.web.authenticated @@ -151,7 +151,10 @@ class QuestionHandler(BaseHandler): 'textarea': 'question-textarea.html', # -- information panels -- 'information': 'question-information.html', + 'info': 'question-information.html', 'success': 'question-success.html', + # 'warning': '', FIXME + # 'alert': '', FIXME } @tornado.web.authenticated @@ -209,12 +212,12 @@ def main(): except: print('An error ocurred while setting up the logging system.') sys.exit(1) - logging.info('===========================================================') + logging.info('====================================================') # --- start application learnapp = LearnApp(arg.conffile[0]) try: - webapp = WebApplication(learnapp, debug=argparser.debug) + webapp = WebApplication(learnapp, debug=arg.debug) except Exception as e: logging.critical('Can\'t start application.') raise e diff --git a/templates/question.html b/templates/question.html index 12e92eb..d22d27b 100644 --- a/templates/question.html +++ b/templates/question.html @@ -7,3 +7,5 @@ {% block answer %}{% end %} + +{{ md(question.get('comments', '')) }} \ No newline at end of file -- libgit2 0.21.2