mirror of
https://github.com/JimmXinu/FanFicFare.git
synced 2025-12-06 08:52:55 +01:00
ConfigParser.read_file added in py3.2, readfp removed in py3.12, only used in plugin #1006
This commit is contained in:
parent
c769900332
commit
0cc3b81580
4 changed files with 9 additions and 5 deletions
|
|
@ -33,8 +33,8 @@ def get_fff_config(url,fileform="epub",personalini=None):
|
|||
except Exception as e:
|
||||
logger.debug("Failed trying to get ini config for url(%s): %s, using section %s instead"%(url,e,sections))
|
||||
configuration = Configuration(sections,fileform)
|
||||
configuration.readfp(StringIO(ensure_text(get_resources("plugin-defaults.ini"))))
|
||||
configuration.readfp(StringIO(ensure_text(personalini)))
|
||||
configuration.read_file(StringIO(ensure_text(get_resources("plugin-defaults.ini"))))
|
||||
configuration.read_file(StringIO(ensure_text(personalini)))
|
||||
|
||||
return configuration
|
||||
|
||||
|
|
|
|||
|
|
@ -466,5 +466,5 @@ def inject_cal_cols(book,story,configuration):
|
|||
extra_valid.append(k)
|
||||
if extra_valid: # if empty, there's nothing to add.
|
||||
injectini.append("add_to_extra_valid_entries:,"+','.join(extra_valid))
|
||||
configuration.readfp(StringIO('\n'.join(injectini)))
|
||||
configuration.read_file(StringIO('\n'.join(injectini)))
|
||||
#print("added:\n%s\n"%('\n'.join(injectini)))
|
||||
|
|
|
|||
|
|
@ -580,7 +580,7 @@ def get_configuration(url,
|
|||
if passed_defaultsini:
|
||||
# new StringIO each time rather than pass StringIO and rewind
|
||||
# for case of list download. Just makes more sense to me.
|
||||
configuration.readfp(StringIO(unicode(passed_defaultsini)))
|
||||
configuration.read_file(StringIO(unicode(passed_defaultsini)))
|
||||
else:
|
||||
# don't need to check existance for our selves.
|
||||
conflist.append(join(dirname(__file__), 'defaults.ini'))
|
||||
|
|
@ -592,7 +592,7 @@ def get_configuration(url,
|
|||
if passed_personalini:
|
||||
# new StringIO each time rather than pass StringIO and rewind
|
||||
# for case of list download. Just makes more sense to me.
|
||||
configuration.readfp(StringIO(unicode(passed_personalini)))
|
||||
configuration.read_file(StringIO(unicode(passed_personalini)))
|
||||
|
||||
conflist.append(join(homepath, 'personal.ini'))
|
||||
conflist.append(join(homepath2, 'personal.ini'))
|
||||
|
|
|
|||
|
|
@ -29,6 +29,10 @@ if six.PY2:
|
|||
else: # PY3
|
||||
ConfigParser = configparser.ConfigParser
|
||||
|
||||
if not hasattr(ConfigParser, 'read_file'):
|
||||
# read_file added in py3.2, readfp removed in py3.12
|
||||
ConfigParser.read_file = ConfigParser.readfp
|
||||
|
||||
from .six import string_types as basestring
|
||||
|
||||
import logging
|
||||
|
|
|
|||
Loading…
Reference in a new issue