+ if not PLOMTASK_DB_PATH:
+ raise HandledException('PLOMTASK_DB_PATH not set.')
+ try:
+ db_file = DatabaseFile(PLOMTASK_DB_PATH)
+ except NotFoundException:
+ yes_or_fail(DB_CREATION_ASK, 'Cannot run without DB.')
+ db_file = DatabaseFile.create_at(PLOMTASK_DB_PATH)
+ except UnmigratedDbException:
+ yes_or_fail(DB_MIGRATE_ASK, 'Cannot run with unmigrated DB.')
+ db_file = DatabaseFile.migrate(PLOMTASK_DB_PATH)
+ server = TaskServer(db_file, ('localhost', HTTP_PORT), TaskHandler)