def launch_report_server(location: str = None, port: int = 5000, host:str ='127.0.0.1'): if location is not None and os.name in ['posix', 'mac']: app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///{}/reporting.db'.format(location) elif location is not None and os.name == 'nt': app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///{}\\reporting.db'.format(location) db.create_all() app_launch = ReportsLauncher() app_launch.port = port app_launch.host = host app_launch.run()
def launch_report(location: str = None): if location is not None and os.name in ['posix', 'mac']: app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///{}/reporting.db'.format(location) elif location is not None and os.name == 'nt': app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///{}\\reporting.db'.format(location) db.create_all() launcher = tk.Tk() app_launch = SupplychainpyReporting(launcher) app_launch.parent.configure(background='black') launcher.mainloop()
def load_db(file: str, location: str = None): from supplychainpy.reporting import load if location is not None and os.name in ['posix', 'mac']: app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///{}/reporting.db'.format(location) elif location is not None and os.name == 'nt': app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///{}\\reporting.db'.format(location) db.create_all() if location is not None: load.load(file, location) else: load.load(file)