Commit 6755e3deab1fdb546e6a71c41008d8d51fd413fa

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

minor comments

aprendizations/learnapp.py
@@ -352,7 +352,7 @@ class LearnApp(object): @@ -352,7 +352,7 @@ class LearnApp(object):
352 topics: Dict[str, Dict] = config.get('topics', {}) 352 topics: Dict[str, Dict] = config.get('topics', {})
353 g.add_nodes_from(topics.keys()) 353 g.add_nodes_from(topics.keys())
354 for tref, attr in topics.items(): 354 for tref, attr in topics.items():
355 - logger.debug(f' + {tref}...') 355 + logger.debug(f' + {tref}')
356 for d in attr.get('deps', []): 356 for d in attr.get('deps', []):
357 if d not in g.nodes(): 357 if d not in g.nodes():
358 logger.error(f'Topic "{tref}" depends on "{d}" but it ' 358 logger.error(f'Topic "{tref}" depends on "{d}" but it '
aprendizations/questions.py
@@ -254,15 +254,15 @@ class QuestionText(Question): @@ -254,15 +254,15 @@ class QuestionText(Question):
254 # apply optional filters to the answer 254 # apply optional filters to the answer
255 def transform(self, ans): 255 def transform(self, ans):
256 for f in self['transform']: 256 for f in self['transform']:
257 - if f == 'remove_space': 257 + if f == 'remove_space': # removes all spaces
258 ans = ans.replace(' ', '') 258 ans = ans.replace(' ', '')
259 - elif f == 'trim': 259 + elif f == 'trim': # removes spaces around
260 ans = ans.strip() 260 ans = ans.strip()
261 - elif f == 'normalize_space': 261 + elif f == 'normalize_space': # replaces multiple spaces by one
262 ans = re.sub(r'\s+', ' ', ans.strip()) 262 ans = re.sub(r'\s+', ' ', ans.strip())
263 - elif f == 'lower': 263 + elif f == 'lower': # convert to lowercase
264 ans = ans.lower() 264 ans = ans.lower()
265 - elif f == 'upper': 265 + elif f == 'upper': # convert to uppercase
266 ans = ans.upper() 266 ans = ans.upper()
267 else: 267 else:
268 logger.warning(f'in "{self["ref"]}", unknown transform "{f}"') 268 logger.warning(f'in "{self["ref"]}", unknown transform "{f}"')
aprendizations/serve.py
@@ -434,7 +434,7 @@ def run_webserver(app, @@ -434,7 +434,7 @@ def run_webserver(app,
434 except Exception: 434 except Exception:
435 logger.critical('Failed to start web application.') 435 logger.critical('Failed to start web application.')
436 raise 436 raise
437 - sys.exit(1) 437 + # sys.exit(1)
438 else: 438 else:
439 logger.info('Web application started (tornado.web.Application)') 439 logger.info('Web application started (tornado.web.Application)')
440 440