Пример #1
0
 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"])
Пример #2
0
 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
Пример #3
0
    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
Пример #4
0
 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
Пример #5
0
 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"])
Пример #6
0
    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"])
Пример #7
0
 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
Пример #8
0
    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"])
Пример #9
0
 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
Пример #10
0
 def get_selected_database(self):
     for key, value in engineAccessors.getDbConnections().iteritems():
         if self.connection_combo.GetStringSelection() == value["name"]:
             return value
     return None
Пример #11
0
 def get_selected_database(self):
     for key, value in engineAccessors.getDbConnections().iteritems():
         if self.connection_combo.GetStringSelection() == value["name"]:
             return value
     return None