From 4f41349076dfb0ebafe467574990fa258fc25b0c Mon Sep 17 00:00:00 2001 From: Miguel Barão Date: Mon, 31 Oct 2016 10:52:21 +0000 Subject: [PATCH] - minor --- app.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app.py b/app.py index ede07e8..32d0f72 100644 --- a/app.py +++ b/app.py @@ -6,7 +6,7 @@ import bcrypt from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker, scoped_session from models import Base, Student, Test, Question -from contextlib import contextmanager # to use `with` statement for db sessions +from contextlib import contextmanager # `with` statement in db sessions import test import threading @@ -23,7 +23,7 @@ class App(object): # uid1: { # 'student': {'number': 123, 'name': john, ...}, # 'test': {...} - # } + # }, # uid2: {...} # } logger.info('============= Running perguntations =============') @@ -54,7 +54,7 @@ class App(object): # ----------------------------------------------------------------------- # helper to manage db sessions using the `with` statement, for example - # with self.db_session() as s: ... + # with self.db_session() as s: s.query(...) @contextmanager def db_session(self): try: @@ -113,7 +113,7 @@ class App(object): return False else: logger.info('Student {}: logged out.'.format(uid)) - del self.online[uid] # FIXME Nao está a gravar o teste como desistencia... + del self.online[uid] return True # ----------------------------------------------------------------------- @@ -121,7 +121,7 @@ class App(object): if uid in self.online: logger.info('Student {}: generating new test.'.format(uid)) student_id = self.online[uid]['student'] - self.lock.acquire() # FIXME is it needed? + self.lock.acquire() self.online[uid]['test'] = self.testfactory.generate(student_id) self.lock.release() return self.online[uid]['test'] -- libgit2 0.21.2