remove garbage about unicode
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
parent
d28ea704c4
commit
eab3e18613
@ -93,11 +93,7 @@ class CustomConfigParser(SafeConfigParser):
|
|||||||
def getlocaleval(self):
|
def getlocaleval(self):
|
||||||
xforms = [os.path.expanduser, os.path.expandvars]
|
xforms = [os.path.expanduser, os.path.expandvars]
|
||||||
if self.has_option("general", "pythonfile"):
|
if self.has_option("general", "pythonfile"):
|
||||||
if globals.options.use_unicode:
|
path = self.get("general", "pythonfile")
|
||||||
path = uni.fsEncode(self.get("general", "pythonfile"),
|
|
||||||
exception_msg="cannot convert character for pythonfile")
|
|
||||||
else:
|
|
||||||
path = self.get("general", "pythonfile")
|
|
||||||
path = self.apply_xforms(path, xforms)
|
path = self.apply_xforms(path, xforms)
|
||||||
else:
|
else:
|
||||||
path = None
|
path = None
|
||||||
@ -112,16 +108,8 @@ class CustomConfigParser(SafeConfigParser):
|
|||||||
For instance, for "Account Test", returns "Test"."""
|
For instance, for "Account Test", returns "Test"."""
|
||||||
|
|
||||||
key = key + ' '
|
key = key + ' '
|
||||||
if globals.options.use_unicode:
|
return [x[len(key):] for x in self.sections() \
|
||||||
sections = []
|
if x.startswith(key)]
|
||||||
for section in self.sections():
|
|
||||||
sections.append(uni.uni2str(section, exception_msg=
|
|
||||||
"non ASCII character in section %s"% section))
|
|
||||||
return [x[len(key):] for x in sections \
|
|
||||||
if x.startswith(key)]
|
|
||||||
else:
|
|
||||||
return [x[len(key):] for x in self.sections() \
|
|
||||||
if x.startswith(key)]
|
|
||||||
|
|
||||||
def set_if_not_exists(self, section, option, value):
|
def set_if_not_exists(self, section, option, value):
|
||||||
"""Set a value if it does not exist yet.
|
"""Set a value if it does not exist yet.
|
||||||
|
Loading…
Reference in New Issue
Block a user