Copy queue file to destination

master
Bob Mottram 2019-08-17 13:26:09 +01:00
parent fe86fe6bf0
commit 0bd6eff877
1 changed files with 8 additions and 7 deletions

View File

@ -999,17 +999,18 @@ def inboxAfterCapabilities(session,keyId: str,handle: str,messageJson: {}, \
if debug:
print('DEBUG: object capabilities passed')
print('copy from '+queueFilename+' to '+destinationFilename)
print('copy queue file from '+queueFilename+' to '+destinationFilename)
if messageJson.get('postNickname'):
with open(destinationFilename, 'w+') as fp:
commentjson.dump(messageJson['post'], fp, indent=4, sort_keys=False)
else:
with open(destinationFilename, 'w+') as fp:
commentjson.dump(messageJson, fp, indent=4, sort_keys=False)
if not os.path.isfile(destinationFilename):
return False
if messageJson.get('postNickname'):
with open(destinationFilename, 'w') as fp:
commentjson.dump(messageJson['post'], fp, indent=4, sort_keys=False)
else:
with open(destinationFilename, 'w') as fp:
commentjson.dump(messageJson, fp, indent=4, sort_keys=False)
return True
def restoreQueueItems(baseDir: str,queue: []) -> None: