Commit f8dd637971334c1b9cd34d0efd677f4239c69310

Authored by Miguel Barão
1 parent df2edbf2
Exists in master and in 1 other branch dev

- minor corrections

app.py
... ... @@ -172,7 +172,7 @@ class LearnApp(object):
172 172 # Load configuration file
173 173 try:
174 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 176 config = yaml.load(f)
177 177 except FileNotFoundError as e:
178 178 logger.error(f'File not found: "{config_file}"')
... ...
questions.py
... ... @@ -389,13 +389,12 @@ class QFactory(object):
389 389 'radio' : QuestionRadio,
390 390 'checkbox' : QuestionCheckbox,
391 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 394 'textarea' : QuestionTextArea,
395 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 398 'alert' : QuestionInformation,
400 399 'success' : QuestionInformation,
401 400 }
... ...
serve.py
... ... @@ -114,7 +114,7 @@ class ChangePasswordHandler(BaseHandler):
114 114 self.write({'msg': notification})
115 115  
116 116 # ----------------------------------------------------------------------------
117   -# /learn
  117 +# /learn main page
118 118 # ----------------------------------------------------------------------------
119 119 class LearnHandler(BaseHandler):
120 120 @tornado.web.authenticated
... ... @@ -151,7 +151,10 @@ class QuestionHandler(BaseHandler):
151 151 'textarea': 'question-textarea.html',
152 152 # -- information panels --
153 153 'information': 'question-information.html',
  154 + 'info': 'question-information.html',
154 155 'success': 'question-success.html',
  156 + # 'warning': '', FIXME
  157 + # 'alert': '', FIXME
155 158 }
156 159  
157 160 @tornado.web.authenticated
... ... @@ -209,12 +212,12 @@ def main():
209 212 except:
210 213 print('An error ocurred while setting up the logging system.')
211 214 sys.exit(1)
212   - logging.info('===========================================================')
  215 + logging.info('====================================================')
213 216  
214 217 # --- start application
215 218 learnapp = LearnApp(arg.conffile[0])
216 219 try:
217   - webapp = WebApplication(learnapp, debug=argparser.debug)
  220 + webapp = WebApplication(learnapp, debug=arg.debug)
218 221 except Exception as e:
219 222 logging.critical('Can\'t start application.')
220 223 raise e
... ...
templates/question.html
... ... @@ -7,3 +7,5 @@
7 7 </div>
8 8  
9 9 {% block answer %}{% end %}
  10 +
  11 +{{ md(question.get('comments', '')) }}
10 12 \ No newline at end of file
... ...