def main(): args = get_user_arguments() app.settings = get_config(args.config_file) root_logger = logging.getLogger("PyFoto") if args.quiet: root_logger.setLevel(logging.ERROR) else: root_logger.setLevel(logging.DEBUG if args.debug else logging.INFO) engine = create_engine(app.settings.connect_string, echo=False) plugin = sqlalchemy.Plugin( engine, Base.metadata, keyword='db', create=True, commit=True, use_kwargs=False ) first_time_setup(engine, app.settings) app.install(plugin) app.org = Organize(engine=engine) bottle.run(app, host=args.ip, port=args.port, server="cherrypy")
def __init__(self, config_file: str="config.yaml", engine=None): self.config = get_config(config_file) if not engine: engine = create_engine(self.config.connect_string) Base.metadata.create_all(engine, checkfirst=True) self.session = sessionmaker(bind=engine)() self.ensure_exists(self.config.storage_directory) self.save_config()
def __init__(self, engine=None): self.config = get_config() if not engine: engine = create_engine(self.config.connect_string) Base.metadata.create_all(engine, checkfirst=True) self.session = sessionmaker(bind=engine)() self.ensure_exists(self.config.video_dir) self.ensure_exists(self.config.image_dir) self.save_config()
def main(): args = get_user_arguments() app.settings = get_config(args.config_file) engine = create_engine(app.settings.connect_string, echo=False) plugin = sqlalchemy.Plugin(engine, Base.metadata, keyword='db', create=True, commit=True, use_kwargs=False) app.install(plugin) app.org = Organize(engine) bottle.run(app, host=args.ip, port=args.port, server="cherrypy")
def main(): args = get_user_arguments() app.settings = get_config(args.config_file) engine = create_engine(app.settings.connect_string, echo=False) plugin = sqlalchemy.Plugin( engine, Base.metadata, keyword='db', create=True, commit=True, use_kwargs=False ) app.install(plugin) app.org = Organize(engine) bottle.run(app, host=args.ip, port=args.port, server="cherrypy")