def main(): ar = argparse.ArgumentParser() ar.add_argument("-d", "--dataset", required=True, help="path to input dataset of images") args = vars(ar.parse_args()) app = Application(args) app.run()
from src.app import Application app = Application() celery = app.celery flask_app = app.flask_app
from src.app import Application if __name__ == '__main__': app = Application() app.run()
from src.models.BoundaryModel import Boundary from src.app import Application import logging import sys if __name__ == '__main__': logging.getLogger().setLevel(logging.INFO) logging.info("Boundary Monitor Start") app = Application() app.start()
parser = ArgumentParser() parser.add_argument('-c', '--config', type=str, required=False, help='Sets config file path') return parser.parse_args() @property def host(self): return self._host @property def port(self): return self._port logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s', handlers=[ logging.FileHandler('../../src/client/client.log', encoding='utf-8'), logging.StreamHandler() ]) config = ConfigFromCLI() with Application() as app: app.host, app.port = config.host, config.port app.run()
from src.app import Application application = Application()
def app(browser): return Application(browser)
return self._host @property def port(self): """Return app port.""" return self._port logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s', handlers=[ logging.FileHandler('../../src/server/server.log', encoding='UTF-8'), logging.StreamHandler(), ]) config = ConfigFromCLI() if config.is_db_migrated: # Import all models from all modules for initialize DB migrations (Base.metadata.create_all() method). module_name_list = [f'{item}.models' for item in INSTALLED_MODULES] module_path_list = (os.path.join(BASE_DIR, item, 'models.py') for item in INSTALLED_MODULES) for index, path in enumerate(module_path_list): if os.path.exists(path): __import__(module_name_list[index]) Base.metadata.create_all() else: with Application(handle_default_request) as app: app.host, app.port = config.host, config.port app.run()
username = userData["name"] if username in threadAssign and threadAssign[username]["thread"].isAlive(): print("resuming USER:"******"thread"].resumeConnection(so) else: if username in threadAssign: print("dead USER", username) threadAssign.pop(username) router.removeUser(username) print("connecting USER:"******".main"), "Main") app = Application(so, adr, userData, router) user=UserMain(app) router.addUser(userData) threadAssign.__setitem__(username, {"thread": user}) user.start() elif mac in devices: deviceData = devices[mac] deviceName = deviceData["name"] if deviceName in threadAssign and threadAssign[deviceName]["thread"].isAlive(): print("resuming DEVICE:", deviceName) threadAssign[deviceName]["thread"].resumeConnection(so)