fix type for settings in configuration file
This commit is contained in:
parent
c53c3f2195
commit
5e76b8caab
|
@ -73,11 +73,18 @@ class SimpleConfig:
|
||||||
elif self.common_config.has_key(key):
|
elif self.common_config.has_key(key):
|
||||||
out = self.common_config.get(key)
|
out = self.common_config.get(key)
|
||||||
|
|
||||||
|
# 3. use the wallet file config
|
||||||
else:
|
else:
|
||||||
out = self.wallet_config.get(key)
|
out = self.wallet_config.get(key)
|
||||||
|
|
||||||
if out is None and default is not None:
|
if out is None and default is not None:
|
||||||
out = default
|
out = default
|
||||||
|
|
||||||
|
# try to fix the type
|
||||||
|
if default is not None and type(out) != type(default):
|
||||||
|
import ast
|
||||||
|
out = ast.literal_eval(out)
|
||||||
|
|
||||||
return out
|
return out
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue