Beispiel #1
0
 def _get_cp_from_ini(self, path):
     '''
     Returns a configparser from a path to an index.txt
     '''
     cp = configparser.SafeConfigParser()
     with io.StringIO(self._download(path)) as buf:
         if sys.version_info.major == 2:  # pragma: no cover
             cp.readfp(buf)
         else:  # pragma: no cover
             cp.read_file(buf)
     return cp
Beispiel #2
0
 def _get_cp_from_ini(self, path):
     """
     Returns a configparser from a path to an index.txt
     """
     cp = configparser.SafeConfigParser()
     with codecs.open(path, mode='r', encoding='UTF-8') as f:
         if sys.version_info.major == 2:  # pragma: no cover
             cp.readfp(f)
         else:  # pragma: no cover
             cp.read_file(f)
     return cp