URI: 
       tsave wallet file as json - electrum - Electrum Bitcoin wallet
  HTML git clone https://git.parazyd.org/electrum
   DIR Log
   DIR Files
   DIR Refs
   DIR Submodules
       ---
   DIR commit 83b9ecac76e8f570305003aaf4635a6364bc1336
   DIR parent f4b390a79f127d0bbe5c178bd849ec87b85f1a5a
  HTML Author: ThomasV <thomasv@gitorious>
       Date:   Wed, 20 Aug 2014 12:47:53 +0200
       
       save wallet file as json
       
       Diffstat:
         M lib/wallet.py                       |      16 +++++++++-------
       
       1 file changed, 9 insertions(+), 7 deletions(-)
       ---
   DIR diff --git a/lib/wallet.py b/lib/wallet.py
       t@@ -24,6 +24,7 @@ import threading
        import random
        import time
        import math
       +import json
        
        from util import print_msg, print_error
        
       t@@ -90,15 +91,16 @@ class WalletStorage(object):
                except IOError:
                    return
                try:
       -            d = ast.literal_eval( data )  #parse raw data from reading wallet file
       -        except Exception:
       -            raise IOError("Cannot read wallet file.")
       -
       +            d = json.loads(data)
       +        except:
       +            try:
       +                d = ast.literal_eval(data)  #parse raw data from reading wallet file
       +            except Exception:
       +                raise IOError("Cannot read wallet file.")
                self.data = d
                self.file_exists = True
        
            def get(self, key, default=None):
       -
                with self.lock:
                    v = self.data.get(key)
                    if v is None:
       t@@ -116,9 +118,9 @@ class WalletStorage(object):
                        self.write()
        
            def write(self):
       -        s = repr(self.data)
       +        s = json.dumps(self.data, indent=4, sort_keys=True)
                f = open(self.path,"w")
       -        f.write( s )
       +        f.write(s)
                f.close()
                if 'ANDROID_DATA' not in os.environ:
                    import stat