def connect(self): config = ConfigProvider().mysql() return mysql.connector.connect(host=config['host'], user=config['user'], password=config['password'], database=config['database'], buffered=True)
def ui(self) -> None: self.setWindowTitle(ConfigProvider().name()) self.setWindowIcon(QtGui.QIcon('resources/polyinf-logo.png')) self.showMaximized() self.status_bar = self.statusBar() self.menu_bar = QtWidgets.QMenuBar(self) self.populate_menu_bar()
def __init__(self, view): super().__init__() self.change_view = view self.current_connection = None self.current_cursor = None mysql_info = ConfigProvider().mysql() connection(mysql_info["host"], mysql_info["user"], mysql_info["password"], self) use_database(mysql_info["database"], self) self.initiate_view()
def __init__(self): super().__init__() self.current_connection = None self.current_cursor = None config = ConfigProvider().mysql() connection(config['host'], config['user'], config['password'], self) use_database(config['database'], self) self.tables = get_all_tables(self) self.initiate_view() self.parentContainer = None
def start(self) -> None: if ConfigProvider().development(): if self.get_arg('--login'): role = self.get_arg('--role') if role: self.get('managers', 'AuthManager').force_login(role) else: self.get('managers', 'AuthManager').force_login() window = self.main_window() window.show() # Attach all loggers to Status Bar self.attach_loggers_to_status_bar(self.container['loggers']) self.log( f'{ConfigProvider().name()} initialized. Version: {self.version}') self.get('managers', 'PluginManager').set_central_widget() exit(self._app.exec_())
def name(self): config = ConfigProvider().mysql() return config['database']
def setup(self): mysql_info = ConfigProvider().mysql() connection(mysql_info["host"], mysql_info["user"], mysql_info["password"], self) use_database(mysql_info["database"], self)
def __init__(self, app): self.app = app self.booting_callbacks = [] self.booted_callbacks = [] self.config_provider = ConfigProvider()
def __init__(self): super().__init__() config = ConfigProvider().mongo() self.client = MongoClient( f'mongodb://{config["host"]}:{config["port"]}/') self.database = self.client[config['database']]