Commit f8dd637971334c1b9cd34d0efd677f4239c69310
1 parent
df2edbf2
Exists in
master
and in
1 other branch
- minor corrections
Showing
4 changed files
with
13 additions
and
9 deletions
Show diff stats
app.py
| @@ -172,7 +172,7 @@ class LearnApp(object): | @@ -172,7 +172,7 @@ class LearnApp(object): | ||
| 172 | # Load configuration file | 172 | # Load configuration file |
| 173 | try: | 173 | try: |
| 174 | with open(config_file, 'r') as f: | 174 | with open(config_file, 'r') as f: |
| 175 | - logger.info(f'Loading configuration file "{config_file}"') | 175 | + logger.info(f'Configuration file "{config_file}"') |
| 176 | config = yaml.load(f) | 176 | config = yaml.load(f) |
| 177 | except FileNotFoundError as e: | 177 | except FileNotFoundError as e: |
| 178 | logger.error(f'File not found: "{config_file}"') | 178 | logger.error(f'File not found: "{config_file}"') |
questions.py
| @@ -389,13 +389,12 @@ class QFactory(object): | @@ -389,13 +389,12 @@ class QFactory(object): | ||
| 389 | 'radio' : QuestionRadio, | 389 | 'radio' : QuestionRadio, |
| 390 | 'checkbox' : QuestionCheckbox, | 390 | 'checkbox' : QuestionCheckbox, |
| 391 | 'text' : QuestionText, | 391 | 'text' : QuestionText, |
| 392 | - 'text_regex': QuestionTextRegex, | ||
| 393 | - 'text_numeric': QuestionTextNumeric, | 392 | + 'text_regex': QuestionTextRegex, 'text-regex': QuestionTextRegex, |
| 393 | + 'text_numeric': QuestionTextNumeric, 'text-numeric': QuestionTextNumeric, | ||
| 394 | 'textarea' : QuestionTextArea, | 394 | 'textarea' : QuestionTextArea, |
| 395 | # -- informative panels -- | 395 | # -- informative panels -- |
| 396 | - 'information': QuestionInformation, | ||
| 397 | - 'info' : QuestionInformation, # same as 'information' | ||
| 398 | - 'warning' : QuestionInformation, | 396 | + 'information': QuestionInformation, 'info': QuestionInformation, |
| 397 | + 'warning' : QuestionInformation, 'warn': QuestionInformation, | ||
| 399 | 'alert' : QuestionInformation, | 398 | 'alert' : QuestionInformation, |
| 400 | 'success' : QuestionInformation, | 399 | 'success' : QuestionInformation, |
| 401 | } | 400 | } |
serve.py
| @@ -114,7 +114,7 @@ class ChangePasswordHandler(BaseHandler): | @@ -114,7 +114,7 @@ class ChangePasswordHandler(BaseHandler): | ||
| 114 | self.write({'msg': notification}) | 114 | self.write({'msg': notification}) |
| 115 | 115 | ||
| 116 | # ---------------------------------------------------------------------------- | 116 | # ---------------------------------------------------------------------------- |
| 117 | -# /learn | 117 | +# /learn main page |
| 118 | # ---------------------------------------------------------------------------- | 118 | # ---------------------------------------------------------------------------- |
| 119 | class LearnHandler(BaseHandler): | 119 | class LearnHandler(BaseHandler): |
| 120 | @tornado.web.authenticated | 120 | @tornado.web.authenticated |
| @@ -151,7 +151,10 @@ class QuestionHandler(BaseHandler): | @@ -151,7 +151,10 @@ class QuestionHandler(BaseHandler): | ||
| 151 | 'textarea': 'question-textarea.html', | 151 | 'textarea': 'question-textarea.html', |
| 152 | # -- information panels -- | 152 | # -- information panels -- |
| 153 | 'information': 'question-information.html', | 153 | 'information': 'question-information.html', |
| 154 | + 'info': 'question-information.html', | ||
| 154 | 'success': 'question-success.html', | 155 | 'success': 'question-success.html', |
| 156 | + # 'warning': '', FIXME | ||
| 157 | + # 'alert': '', FIXME | ||
| 155 | } | 158 | } |
| 156 | 159 | ||
| 157 | @tornado.web.authenticated | 160 | @tornado.web.authenticated |
| @@ -209,12 +212,12 @@ def main(): | @@ -209,12 +212,12 @@ def main(): | ||
| 209 | except: | 212 | except: |
| 210 | print('An error ocurred while setting up the logging system.') | 213 | print('An error ocurred while setting up the logging system.') |
| 211 | sys.exit(1) | 214 | sys.exit(1) |
| 212 | - logging.info('===========================================================') | 215 | + logging.info('====================================================') |
| 213 | 216 | ||
| 214 | # --- start application | 217 | # --- start application |
| 215 | learnapp = LearnApp(arg.conffile[0]) | 218 | learnapp = LearnApp(arg.conffile[0]) |
| 216 | try: | 219 | try: |
| 217 | - webapp = WebApplication(learnapp, debug=argparser.debug) | 220 | + webapp = WebApplication(learnapp, debug=arg.debug) |
| 218 | except Exception as e: | 221 | except Exception as e: |
| 219 | logging.critical('Can\'t start application.') | 222 | logging.critical('Can\'t start application.') |
| 220 | raise e | 223 | raise e |