Fix domains parse starting with whitespace

This commit is contained in:
HelloZeroNet 2016-03-12 13:25:26 +01:00
parent 25752c927c
commit 56dbd88889

View file

@ -16,7 +16,7 @@ def publish():
def processNameOp(domain, value): def processNameOp(domain, value):
if not value.startswith("{"): if not value.strip().startswith("{"):
return False return False
try: try:
data = json.loads(value) data = json.loads(value)
@ -55,9 +55,10 @@ def processNameOp(domain, value):
new_names_raw = json.dumps(names, indent=2, sort_keys=True) new_names_raw = json.dumps(names, indent=2, sort_keys=True)
if new_names_raw != names_raw: if new_names_raw != names_raw:
open(names_path, "wb").write(new_names_raw) open(names_path, "wb").write(new_names_raw)
print "-", domain, "Changed"
return True return True
else: else:
print "names not changed" print "-", domain, "Not changed"
return False return False