Beispiel #1
0
 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
Beispiel #2
0
 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
Beispiel #3
0
 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)
Beispiel #4
0
 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)
Beispiel #5
0
# -*- 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')
Beispiel #6
0
# -*- 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')
Beispiel #7
0
# 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')