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