"""
The SimpleConfig class is responsible for handling operations involving
configuration files. The constructor reads and stores the system and
-user configurations from electrum.conf into seperate dictionaries within
+user configurations from electrum.conf into separate dictionaries within
a SimpleConfig instance then reads the wallet file.
"""
def __init__(self, options={}):
try:
out = ast.literal_eval(out)
except:
- print "type error, using default value"
+ print "type error for '%s': using default value"%key
out = default
return out
except ConfigParser.NoSectionError:
pass
-
def init_path(self, path):
"""Set the path of the wallet."""
- def save(self):
+ def save(self, key=None):
self.save_wallet_config()
def save_wallet_config(self):
+ # prevent the creation of incomplete wallets
+ if self.wallet_config.get('master_public_keys') is None:
+ return
+
s = repr(self.wallet_config)
f = open(self.path,"w")
f.write( s )