コード例 #1
0
ファイル: SimulationsTabCtrl.py プロジェクト: Castronova/EMIT
 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
ファイル: CanvasCtrl.py プロジェクト: MachineAi/EMIT
 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
ファイル: PreRunCtrl.py プロジェクト: MachineAi/EMIT
    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
ファイル: CanvasCtrl.py プロジェクト: Castronova/EMIT
 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
ファイル: SimulationsTabCtrl.py プロジェクト: MachineAi/EMIT
 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
ファイル: TimeSeriesCtrl.py プロジェクト: Castronova/EMIT
    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
ファイル: TimeSeriesCtrl.py プロジェクト: Castronova/EMIT
 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
ファイル: SimulationsTabCtrl.py プロジェクト: Castronova/EMIT
 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
ファイル: SimulationsTabCtrl.py プロジェクト: MachineAi/EMIT
 def get_selected_database(self):
     for key, value in engineAccessors.getDbConnections().iteritems():
         if self.connection_combo.GetStringSelection() == value["name"]:
             return value
     return None