Example #1
0
    def __init__(self,
                 ini_filename='',
                 autosave=False,
                 parent=None,
                 debug=False):
        self.ini_filename = ini_filename
        self.autosave = autosave
        self.parent = parent
        self.debug = debug
        self.database = None

        self.database_dialog = Portlets.Database()
        self.DialogBox = Dialogs.Simple(parent=self.parent)
        self.ini_file = FileSystem.iniFile(self.ini_filename)
        self.portlet = self.database_dialog.create()

        db_engines_list = SQLdb.get_engines()
        self.config_dic = self.get_settings_from_ini()

        odbc_drivers_list = dbTools.get_odbc_drivers()
        self.database_dialog.populate(db_engines_list, odbc_drivers_list,
                                      self.config_dic)

        self.database_dialog.connect_order = self.connect
        self.database_dialog.disconnect_order = self.disconnect
Example #2
0
    def initialize(self, event=None):
        # Populate comboboxes -------------------------------------------------
        odbc_drivers_list = dbTools.get_odbc_drivers()
        self.combobox_odbc.AppendItems(odbc_drivers_list)

        db_engines_list = SQLdb.get_engines()
        self.combobox_engine.AppendItems(db_engines_list)

        # Populate the rest ---------------------------------------------------
        options = {
            'engine': '',
            'driver': '',
            'database': '',
            'host': '',
            'user': '',
            'password': '',
            'filepath': ''
        }

        self.section_dict = self.ini_file.get_section(section=self.ini_section,
                                                      option_dict=options)

        self.form_dict = {
            'engines_list': db_engines_list,
            'drivers_list': odbc_drivers_list
        }
        self.form_dict.update(self.section_dict)
        self.populate(self.form_dict)

        self.on_connect = self.connect
        self.on_disconnect = self.disconnect
Example #3
0
    def initialize(self, event=None):
        # Populate comboboxes -------------------------------------------------
        odbc_drivers_list = dbTools.get_odbc_drivers()
        self.combobox_odbc.AppendItems(odbc_drivers_list)

        db_engines_list = SQLdb.get_engines()
        self.combobox_engine.AppendItems(db_engines_list)

        # Populate the rest ---------------------------------------------------
        options = {"engine": "", "driver": "", "database": "", "host": "", "user": "", "password": "", "filepath": ""}

        self.section_dict = self.ini_file.get_section(section=self.ini_section, option_dict=options)

        self.form_dict = {"engines_list": db_engines_list, "drivers_list": odbc_drivers_list}
        self.form_dict.update(self.section_dict)
        self.populate(self.form_dict)

        self.on_connect = self.connect
        self.on_disconnect = self.disconnect
Example #4
0
    def __init__(self, ini_filename='', autosave=False, parent=None, debug=False):
        self.ini_filename = ini_filename
        self.autosave = autosave
        self.parent = parent
        self.debug = debug
        self.database = None

        self.database_dialog = Portlets.Database()
        self.DialogBox = Dialogs.Simple(parent=self.parent)
        self.ini_file = FileSystem.iniFile(self.ini_filename)
        self.portlet = self.database_dialog.create()
        
        db_engines_list = SQLdb.get_engines()
        self.config_dic = self.get_settings_from_ini()
        
        odbc_drivers_list = dbTools.get_odbc_drivers()
        self.database_dialog.populate(db_engines_list, odbc_drivers_list, self.config_dic)

        self.database_dialog.connect_order = self.connect
        self.database_dialog.disconnect_order = self.disconnect