bip32
[electrum-nvc.git] / lib / simple_config.py
index a94b837..f8a9e00 100644 (file)
@@ -10,7 +10,7 @@ class SimpleConfig:
     """
 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={}):
@@ -94,7 +94,7 @@ a SimpleConfig instance then reads the wallet file.
             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
@@ -151,7 +151,6 @@ a SimpleConfig instance then reads the wallet file.
             except ConfigParser.NoSectionError:
                 pass
 
-
     def init_path(self, path):
         """Set the path of the wallet."""
 
@@ -201,11 +200,15 @@ a SimpleConfig instance then reads the wallet file.
 
 
 
-    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 )