1
0

store contacts and invoices in wallet file. fix #1482

This commit is contained in:
ThomasV
2017-03-06 17:12:27 +01:00
parent acd70f55c3
commit dcffea150e
13 changed files with 96 additions and 91 deletions

View File

@@ -622,37 +622,6 @@ class QueuePipe:
class StoreDict(dict):
def __init__(self, config, name):
self.config = config
self.path = os.path.join(self.config.path, name)
self.load()
def load(self):
try:
with open(self.path, 'r') as f:
self.update(json.loads(f.read()))
except:
pass
def save(self):
with open(self.path, 'w') as f:
s = json.dumps(self, indent=4, sort_keys=True)
r = f.write(s)
def __setitem__(self, key, value):
dict.__setitem__(self, key, value)
self.save()
def pop(self, key):
if key in self.keys():
dict.pop(self, key)
self.save()
def check_www_dir(rdir):
import urllib, urlparse, shutil, os
if not os.path.exists(rdir):