88 `ConfigParser`. More information and documentation for configobj can be
99 found at http://www.voidspace.org.uk/python/configobj.html.
1010"""
11- from __future__ import (absolute_import , division , print_function ,
12- unicode_literals )
13- from ..extern import six
1411
1512from contextlib import contextmanager
1613import hashlib
@@ -72,13 +69,12 @@ def __init__(cls, name, bases, dict):
7269 if cls .__bases__ [0 ] is object :
7370 return
7471
75- for key , val in six . iteritems ( dict ):
72+ for key , val in dict . items ( ):
7673 if isinstance (val , ConfigItem ):
7774 val .name = key
7875
7976
80- @six .add_metaclass (_ConfigNamespaceMeta )
81- class ConfigNamespace (object ):
77+ class ConfigNamespace (metaclass = _ConfigNamespaceMeta ):
8278 """
8379 A namespace of configuration items. Each subpackage with
8480 configuration items should define a subclass of this class,
@@ -135,7 +131,7 @@ def reload(self, attr=None):
135131 return self .__class__ .__dict__ [attr ].reload ()
136132 raise AttributeError ("No configuration parameter '{0}'" .format (attr ))
137133
138- for item in six . itervalues ( self .__class__ .__dict__ ):
134+ for item in self .__class__ .__dict__ . values ( ):
139135 if isinstance (item , ConfigItem ):
140136 item .reload ()
141137
@@ -156,13 +152,12 @@ def reset(self, attr=None):
156152 return
157153 raise AttributeError ("No configuration parameter '{0}'" .format (attr ))
158154
159- for item in six . itervalues ( self .__class__ .__dict__ ):
155+ for item in self .__class__ .__dict__ . values ( ):
160156 if isinstance (item , ConfigItem ):
161157 item .set (item .defaultvalue )
162158
163159
164- @six .add_metaclass (InheritDocstrings )
165- class ConfigItem (object ):
160+ class ConfigItem (metaclass = InheritDocstrings ):
166161 """
167162 A setting and associated value stored in a configuration file.
168163
@@ -242,9 +237,9 @@ def __init__(self, defaultvalue='', description=None, cfgtype=None,
242237 # now determine cfgtype if it is not given
243238 if cfgtype is None :
244239 if (isiterable (defaultvalue ) and not
245- isinstance (defaultvalue , six . string_types )):
240+ isinstance (defaultvalue , str )):
246241 # it is an options list
247- dvstr = [six . text_type (v ) for v in defaultvalue ]
242+ dvstr = [str (v ) for v in defaultvalue ]
248243 cfgtype = 'option(' + ', ' .join (dvstr ) + ')'
249244 defaultvalue = dvstr [0 ]
250245 elif isinstance (defaultvalue , bool ):
@@ -253,9 +248,9 @@ def __init__(self, defaultvalue='', description=None, cfgtype=None,
253248 cfgtype = 'integer'
254249 elif isinstance (defaultvalue , float ):
255250 cfgtype = 'float'
256- elif isinstance (defaultvalue , six . string_types ):
251+ elif isinstance (defaultvalue , str ):
257252 cfgtype = 'string'
258- defaultvalue = six . text_type (defaultvalue )
253+ defaultvalue = str (defaultvalue )
259254
260255 self .cfgtype = cfgtype
261256
@@ -264,7 +259,7 @@ def __init__(self, defaultvalue='', description=None, cfgtype=None,
264259
265260 if aliases is None :
266261 self .aliases = []
267- elif isinstance (aliases , six . string_types ):
262+ elif isinstance (aliases , str ):
268263 self .aliases = [aliases ]
269264 else :
270265 self .aliases = aliases
@@ -604,7 +599,7 @@ def is_unedited_config_file(content, template_content=None):
604599 buffer = io .BytesIO (content )
605600 buffer .seek (0 )
606601 raw_cfg = configobj .ConfigObj (buffer , interpolation = True )
607- for v in six . itervalues ( raw_cfg ):
602+ for v in raw_cfg . values ( ):
608603 if len (v ):
609604 break
610605 else :
0 commit comments