Browse Source

Fix wallet write to support windows

283
Maran 10 years ago
parent
commit
21673c95f4
  1. 7
      lib/wallet.py

7
lib/wallet.py

@ -135,15 +135,18 @@ class WalletStorage(object):
def write(self):
assert not threading.currentThread().isDaemon()
temp_path = self.path + '.tmp'
s = json.dumps(self.data, indent=4, sort_keys=True)
with open(self.path + '.tmp', "w") as f:
with open(temp_path, "w") as f:
f.write(s)
os.rename(self.path + '.tmp', self.path)
os.remove(self.path)
os.rename(temp_path, self.path)
if 'ANDROID_DATA' not in os.environ:
import stat
os.chmod(self.path,stat.S_IREAD | stat.S_IWRITE)
class Abstract_Wallet(object):
"""
Wallet classes are created to handle various address generation methods.

Loading…
Cancel
Save