changeset 11:c77259f467a3

hopefully OrderedDict preservation actually works now
author Jeff Hammel <k0scist@gmail.com>
date Tue, 23 Aug 2016 18:17:11 -0700
parents 66d11212175d
children 4faed08eb8d8
files martini/config.py setup.py
diffstat 2 files changed, 10 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/martini/config.py	Tue Aug 23 09:26:27 2016 -0700
+++ b/martini/config.py	Tue Aug 23 18:17:11 2016 -0700
@@ -26,7 +26,8 @@
 
     if os.path.exists(resource):
         return file(resource)
-    if sum([resource.startswith(http) for http in 'http://', 'https://']):
+    if sum([resource.startswith(http)
+            for http in 'http://', 'https://']):
         return urllib2.urlopen(resource)
     return StringIO(resource)
 
@@ -64,13 +65,15 @@
             _section = self[section]
             self.remove_section(section)
         else:
-            _section = {}
-        self.read({newname: _section})
+            _section = OrderedDict()
+        self.read(OrderedDict(newname=_section))
 
     def dict(self):
-        """return a dictionary of dictionaries;
+        """
+        return a dictionary of dictionaries:
         the outer with keys of section names;
-        the inner with keys, values of the section"""
+        the inner with keys, values of the section
+        """
         return OrderedDict([(section, self[section])
                             for section in self.sections()])
 
--- a/setup.py	Tue Aug 23 09:26:27 2016 -0700
+++ b/setup.py	Tue Aug 23 18:17:11 2016 -0700
@@ -6,7 +6,7 @@
 except:
     description = ''
 
-version = '0.4.1'
+version = '0.4.2'
 
 setup(name='martINI',
       version=version,
@@ -23,7 +23,7 @@
       zip_safe=False,
       install_requires=[
           # -*- Extra requirements: -*-
-         'WebOb',	
+         'WebOb',
          'Paste',
          'PasteScript',
          'genshi'