def _gather_from_ini(self, ini, section, excluded): """Return a list of items from an ini setting file""" result = [] result.append(('FILENAME', ini)) for item in configuration.get_config_options(ini, section): if not self._exclude_item(item.upper(), item, excluded): result.append((item.upper(), configuration.get_config_string(ini, section, item))) return result
def _gather_from_ini(self, ini, section, excluded): """Return a list of items from an ini setting file""" result = [] result.append(('FILENAME', ini)) for item in configuration.get_config_options(ini, section): if not self._exclude_item(item.upper(), item, excluded): result.append( (item.upper(), configuration.get_config_string(ini, section, item))) return result
def open(self): """Open the connection""" super(self.__class__, self).open() if __NATIVE_DB2__: # Connect to the local system using db2 self.connection = db2.connect('') else: # Connect to the remote system using JDBC self.connection = jaydebeapi.connect( jclassname='com.ibm.as400.access.AS400JDBCDriver', driver_args=[ 'jdbc:as400://%s' % self.connection_string, self.username, self.password ], jars=configuration.get_config_string(SETTINGS_FILENAME, 'GENERAL', 'JT400.JAR'), libs=None)
def open(self): """Open the connection""" super(self.__class__, self).open() if __NATIVE_DB2__: # Connect to the local system using db2 self.connection = db2.connect('') else: # Connect to the remote system using JDBC self.connection = jaydebeapi.connect( jclassname='com.ibm.as400.access.AS400JDBCDriver', driver_args=[ 'jdbc:as400://%s' % self.connection_string, self.username, self.password], jars=configuration.get_config_string( SETTINGS_FILENAME, 'GENERAL', 'JT400.JAR'), libs=None)
# -*- coding: UTF-8 -*- import os.path import configuration from app_constants import DIR_CONF MODULE_NAME = os.path.basename(os.path.dirname(__file__)) SETTINGS_FILENAME = '%s%s.ini' % (MODULE_NAME, os.path.isfile( configuration.get_path(DIR_CONF, '%s_custom.ini' % MODULE_NAME)) \ and '_custom' or '') SETTINGS_DB = configuration.get_config_string( SETTINGS_FILENAME, 'GENERAL', 'SETTINGS')
# -*- coding: UTF-8 -*- import os.path import configuration from app_constants import DIR_CONF MODULE_NAME = os.path.basename(os.path.dirname(__file__)) SETTINGS_FILENAME = '%s%s.ini' % (MODULE_NAME, os.path.isfile( configuration.get_path(DIR_CONF, '%s_custom.ini' % MODULE_NAME)) \ and '_custom' or '') SETTINGS_DB = configuration.get_config_string(SETTINGS_FILENAME, 'GENERAL', 'SETTINGS')
# Import standard modules import os.path # Import local modules import configuration from app_constants import FILE_CONFIGURATION MODULE_NAME = os.path.basename(os.path.dirname(__file__)) SETTINGS_DB = configuration.get_config_string(FILE_CONFIGURATION, MODULE_NAME, 'SETTINGS')