コード例 #1
0
 def connect(self):
     try:
         self.config_dic = self.database_dialog.get_config_dic()
         self.database = SQLdb.database(self.config_dic['engine'], debug=self.debug)
         self.database.connect(database=self.config_dic['database'],
                               driver=self.config_dic['driver'],
                               host=self.config_dic['host'],
                               user=self.config_dic['user'],
                               password=self.config_dic['password'])
         self.database_dialog.set_connected()
         
         # Save .ini-file automatically on connection
         if self.autosave == True:
             self.save_settings_to_ini()
     except Exception, inst:
         self.DialogBox.show(dialog_type='error', title='Fehler', inst=inst)
         self.database_dialog.set_disconnected()
コード例 #2
0
ファイル: gtkPortlets.py プロジェクト: PyCManager/baseui
    def connect(self):
        try:
            self.config_dic = self.database_dialog.get_config_dic()
            self.database = SQLdb.database(self.config_dic['engine'],
                                           debug=self.debug)
            self.database.connect(database=self.config_dic['database'],
                                  driver=self.config_dic['driver'],
                                  host=self.config_dic['host'],
                                  user=self.config_dic['user'],
                                  password=self.config_dic['password'])
            self.database_dialog.set_connected()

            # Save .ini-file automatically on connection
            if self.autosave == True:
                self.save_settings_to_ini()
        except Exception, inst:
            self.DialogBox.show(dialog_type='error', title='Fehler', inst=inst)
            self.database_dialog.set_disconnected()
コード例 #3
0
ファイル: wxPanels.py プロジェクト: BackupTheBerlios/baseui
    def connect(self):
        """ Trys to connect the database with given parameters. """

        try:
            self.section_dict = self.get_content()
            self.database = SQLdb.database(self.section_dict.get("engine"))
            self.database.connect(
                database=self.section_dict.get("database"),
                driver=self.section_dict.get("driver"),
                host=self.section_dict.get("host"),
                user=self.section_dict.get("user"),
                password=self.section_dict.get("password"),
                filepath=self.section_dict.get("filepath"),
            )
            self.set_connected()

            # Save .ini-file automatically on connection
            if self.autosave == True:
                self.save_settings()
        except Exception, inst:
            self.set_disconnected()
            self.ErrorDialog.show(message="Datenbank konnte nicht verbunden werden.", instance=inst)
コード例 #4
0
ファイル: wxPanels.py プロジェクト: PyCManager/baseui
    def connect(self):
        ''' Trys to connect the database with given parameters. '''

        try:
            self.section_dict = self.get_content()
            self.database = SQLdb.database(self.section_dict.get('engine'))
            self.database.connect(database=self.section_dict.get('database'),
                                  driver=self.section_dict.get('driver'),
                                  host=self.section_dict.get('host'),
                                  user=self.section_dict.get('user'),
                                  password=self.section_dict.get('password'),
                                  filepath=self.section_dict.get('filepath'))
            self.set_connected()

            # Save .ini-file automatically on connection
            if self.autosave == True:
                self.save_settings()
        except Exception, inst:
            self.set_disconnected()
            self.ErrorDialog.show(
                message='Datenbank konnte nicht verbunden werden.',
                instance=inst)