From: Diane Trout Date: Thu, 29 Jan 2015 00:08:21 +0000 (-0800) Subject: use six to work around rename of configparser X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=htsworkflow.git;a=commitdiff_plain;h=31b8e4cad0eb470e85ef2e3502ade1dc07015c44 use six to work around rename of configparser --- diff --git a/htsworkflow/util/api.py b/htsworkflow/util/api.py index 7abfa2a..ce97e18 100644 --- a/htsworkflow/util/api.py +++ b/htsworkflow/util/api.py @@ -1,7 +1,7 @@ """Common functions for accessing the HTS Workflow REST API """ import base64 -from ConfigParser import SafeConfigParser +from six.moves import configparser import random import logging @@ -23,7 +23,7 @@ def add_auth_options(parser): """Add options OptParser configure authentication options """ # Load defaults from the config files - config = SafeConfigParser() + config = configparser.SafeConfigParser() config.read([os.path.expanduser('~/.htsworkflow.ini'), '/etc/htsworkflow.ini' ]) diff --git a/htsworkflow/util/config_helper.py b/htsworkflow/util/config_helper.py index 4b86da4..b14e95d 100644 --- a/htsworkflow/util/config_helper.py +++ b/htsworkflow/util/config_helper.py @@ -2,20 +2,20 @@ """ import logging import os -import ConfigParser +from six.moves import configparser from htsworkflow.util.api import make_django_secret_key LOGGER = logging.getLogger(__name__) -class HTSWConfig(ConfigParser.SafeConfigParser): +class HTSWConfig(configparser.SafeConfigParser): '''Customization of SafeConfigParser that can open and save itself. ''' def __init__(self, path=[os.path.expanduser("~/.htsworkflow.ini"), '/etc/htsworkflow.ini',]): # ConfigParser isn't a new-style class? lame - # super(ConfigParser.SafeConfigParser, self).__init__() - ConfigParser.SafeConfigParser.__init__(self) + # super(configparser.SafeConfigParser, self).__init__() + configparser.SafeConfigParser.__init__(self) read_path = self.read(path) if len(read_path) > 0: self.filename = read_path[0] diff --git a/requirements/base.txt b/requirements/base.txt index 34f8692..ccfb05d 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -11,3 +11,4 @@ pytz>=2011 requests>=2.0 wsgiref==0.1.2 factory_boy>=2.4 +six>=1.8