def on_refresh_connection_combo(self, event): """ Refreshes/updates the connection combo box. This method is fired when the engine has loaded the database :param event: :return: """ connections = engineAccessors.getDbConnections() for key, value in connections.iteritems(): self.append_to_connection_combo(value["name"])
def get_current_database_session(self, dbName=None): if dbName is not None: dbs = engine.getDbConnections() for db in dbs.iterkeys(): if dbs[db]['name'] == dbName: self._currentDbSession = dbUtilities.build_session_from_connection_string( dbs[db]['connection_string']) break return self._currentDbSession
def get_databases(self): ''' Queries the engine for the known databases :return: a list of databases that are loaded into the engine ''' # query the engine to get all available database connections available_connections = engineAccessors.getDbConnections() return available_connections
def load_connection_combo(self): # Add the wof sites to the connection combo option self.wof_names = get_wof_json_as_dictionary() self.connection_options = ["---"] for key, value in self.wof_names.iteritems(): self.append_to_connection_combo(key) connections = engineAccessors.getDbConnections() for key, value in connections.iteritems(): self.append_to_connection_combo(connections[key]["name"])
def get_selected_database(self): """ Returns an empty string when a wof site or --- is selected :return: """ db = {} for key, value in engineAccessors.getDbConnections().iteritems(): if self.connection_combo.GetStringSelection() == value["name"]: db = value break return db
def get_selected_database(self): for key, value in engineAccessors.getDbConnections().iteritems(): if self.connection_combo.GetStringSelection() == value["name"]: return value return None