use six to work around rename of configparser
authorDiane Trout <diane@ghic.org>
Thu, 29 Jan 2015 00:08:21 +0000 (16:08 -0800)
committerDiane Trout <diane@ghic.org>
Thu, 29 Jan 2015 18:46:51 +0000 (10:46 -0800)
htsworkflow/util/api.py
htsworkflow/util/config_helper.py
requirements/base.txt

index 7abfa2a2266594147946c875a87c85213d3975d0..ce97e18d84cf6bfddc91f0f12660f5dfd9dbdaaf 100644 (file)
@@ -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'
                  ])
index 4b86da4541de29d3c9430eeb9acd92ca9cbf7b46..b14e95d006a79b50dda19897864cc7513b036d79 100644 (file)
@@ -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]
index 34f86923597aaa7f6991bfcda61f62a3e65f8011..ccfb05d5d2e34ac16841597874c57d4f605c81f8 100644 (file)
@@ -11,3 +11,4 @@ pytz>=2011
 requests>=2.0
 wsgiref==0.1.2
 factory_boy>=2.4
+six>=1.8