X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=htsworkflow.git;a=blobdiff_plain;f=htsworkflow%2Fsettings.py;h=048d35cc9391580b4fe0d9212a2dcadff3ff1bf5;hp=a0652c2dbdf9611131385e0c389778782efff41d;hb=refs%2Fheads%2Fpython3-django1.5;hpb=4262586d10cc0cc227390873b301b55244204c11 diff --git a/htsworkflow/settings.py b/htsworkflow/settings.py index a0652c2..048d35c 100644 --- a/htsworkflow/settings.py +++ b/htsworkflow/settings.py @@ -27,7 +27,7 @@ The options understood by this module are (with their defaults): localhost=127.0.0.1 """ -import ConfigParser +import configparser import logging import os import shlex @@ -60,14 +60,14 @@ def options_to_dict(dest, section_name): dest[name] = options.get(section_name, name) # define your defaults here -options = ConfigParser.SafeConfigParser() +options = configparser.SafeConfigParser() def save_options(filename, options): try: ini_stream = open(filename, 'w') options.write(ini_stream) ini_stream.close() - except IOError, e: + except IOError as e: LOGGER.debug("Error saving setting: %s" % (str(e))) INI_FILE = options.read([os.path.expanduser("~/.htsworkflow.ini"), @@ -118,13 +118,13 @@ NOTIFICATION_BCC = [] options_to_list(options, NOTIFICATION_BCC, 'frontend', 'notification_bcc') if not options.has_option('frontend', 'database'): - raise ConfigParser.NoSectionError( + raise configparser.NoSectionError( "Please define [frontend] database=
") database_section = options.get('frontend', 'database') if not options.has_section(database_section): - raise ConfigParser.NoSectionError( + raise configparser.NoSectionError( "No database= defined") # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'ado_mssql'.