def postgresql_settings(self): ''' accepts connection settings and then attempt database connection for PostgreSQL ''' global login_button global postgresql_install_status variables.database_type = 'PostgreSQL' variables.username = str(self.username_linedit.text()) variables.password = str(self.password_linedit.text()) if postgresql_install_status != 'Not Installed': variables.server_name_label = 'PostgreSQL Server:' variables.server_port_check_label = 'PostgreSQL Port:' variables.server_settings_title = 'PostgreSQL Server Connection Settings' variables.default_server_port_label = '( Default PostgreSQL port is 5432 TCP )' variables.server_logo = '%s/Icons/postgresql.ico' % (os.getcwd()) if variables.username == '': QtGui.QMessageBox.warning( self, "Username error", "Please Input a username and press the lock button to enable Generic database mode" ) self.username_linedit.setFocus() elif self.login_button.isChecked() == False: QtGui.QMessageBox.warning( self, "Lock Button", "Please press the Lock Button to enable Generic database mode" ) self.login_button.setFocus() elif variables.database_postgresql_status == 'connected': self.database_interaction() else: run_settings_dialog = connection.connection_setting_dialog() run_settings_dialog.exec_() else: global api_reference global api_server_name global api_installation global api_download_link api_server_name = 'PostgreSQL' api_download_link = '<font color=blue>apt-get install python-psycopg2</font>' api_reference = '<font color=blue>http://wiki.python.org/moin/PostgreSQL</font>' api_installation = '' run_api_dialog = api_install_link() run_api_dialog.exec_()
def oracle_settings(self): # ORACLE SETTINGS ''' accepts connection settings and then attempt database connection for Oracle ''' global login_button global oracle_install_status variables.database_type = 'Oracle' variables.username = str(self.username_linedit.text()) variables.password = str(self.password_linedit.text()) if oracle_install_status != 'Not Installed': variables.server_name_label = 'Oracle Server:' variables.server_port_check_label = 'Oracle Port:' variables.server_settings_title = 'Oracle Server Connection Settings' variables.default_server_port_label = '( Default Oracle port is 1521 TCP )' variables.server_logo = '%s/Icons/Oracle_Logo.ico' % (os.getcwd()) if variables.username == '': QtGui.QMessageBox.warning( self, "Username error", "Please Input a username and press the lock button to enable Generic database mode" ) self.username_linedit.setFocus() elif self.login_button.isChecked() == False: QtGui.QMessageBox.warning( self, "Lock Button", "Please press the Lock Button to enable Generic database mode" ) self.login_button.setFocus() elif variables.database_oracle_status == 'connected': self.database_interaction() else: run_settings_dialog = connection.connection_setting_dialog() run_settings_dialog.exec_() else: global api_reference global api_server_name global api_installation global api_download_link api_server_name = 'Oracle' api_download_link = '<font color=blue>Please check the "Oracle-API-installation" note file for instructions on how to install Oracle\'s API bindings</font>' api_reference = '<font color=blue>http://wiki.oracle.com/page/Python</font>' api_installation = '' run_api_dialog = api_install_link() run_api_dialog.exec_()
def postgresql_settings(self): ''' accepts connection settings and then attempt database connection for PostgreSQL ''' global login_button global postgresql_install_status variables.database_type = 'PostgreSQL' variables.username = str(self.username_linedit.text()) variables.password = str(self.password_linedit.text()) if postgresql_install_status != 'Not Installed': variables.server_name_label = 'PostgreSQL Server:' variables.server_port_check_label = 'PostgreSQL Port:' variables.server_settings_title = 'PostgreSQL Server Connection Settings' variables.default_server_port_label = '( Default PostgreSQL port is 5432 TCP )' variables.server_logo = '%s/Icons/postgresql.ico'%(os.getcwd()) if variables.username == '': QtGui.QMessageBox.warning(self,"Username error","Please Input a username and press the lock button to enable Generic database mode") self.username_linedit.setFocus() elif self.login_button.isChecked() == False: QtGui.QMessageBox.warning(self,"Lock Button","Please press the Lock Button to enable Generic database mode") self.login_button.setFocus() elif variables.database_postgresql_status == 'connected': self.database_interaction() else: run_settings_dialog = connection.connection_setting_dialog() run_settings_dialog.exec_() else: global api_reference global api_server_name global api_installation global api_download_link api_server_name = 'PostgreSQL' api_download_link = '<font color=blue>apt-get install python-psycopg2</font>' api_reference = '<font color=blue>http://wiki.python.org/moin/PostgreSQL</font>' api_installation = '' run_api_dialog = api_install_link() run_api_dialog.exec_()
def oracle_settings(self): # ORACLE SETTINGS ''' accepts connection settings and then attempt database connection for Oracle ''' global login_button global oracle_install_status variables.database_type = 'Oracle' variables.username = str(self.username_linedit.text()) variables.password = str(self.password_linedit.text()) if oracle_install_status != 'Not Installed': variables.server_name_label = 'Oracle Server:' variables.server_port_check_label = 'Oracle Port:' variables.server_settings_title = 'Oracle Server Connection Settings' variables.default_server_port_label = '( Default Oracle port is 1521 TCP )' variables.server_logo = '%s/Icons/Oracle_Logo.ico'%(os.getcwd()) if variables.username == '': QtGui.QMessageBox.warning(self,"Username error","Please Input a username and press the lock button to enable Generic database mode") self.username_linedit.setFocus() elif self.login_button.isChecked() == False: QtGui.QMessageBox.warning(self,"Lock Button","Please press the Lock Button to enable Generic database mode") self.login_button.setFocus() elif variables.database_oracle_status == 'connected': self.database_interaction() else: run_settings_dialog = connection.connection_setting_dialog() run_settings_dialog.exec_() else: global api_reference global api_server_name global api_installation global api_download_link api_server_name = 'Oracle' api_download_link = '<font color=blue>Please check the "Oracle-API-installation" note file for instructions on how to install Oracle\'s API bindings</font>' api_reference = '<font color=blue>http://wiki.oracle.com/page/Python</font>' api_installation = '' run_api_dialog = api_install_link() run_api_dialog.exec_()