Commit 0026e02b authored by Nicolas Delaby's avatar Nicolas Delaby

Modify return value name to improve readability of code


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk/utils@44737 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 011cd45f
...@@ -192,9 +192,10 @@ class Handler(object): ...@@ -192,9 +192,10 @@ class Handler(object):
finally: finally:
openoffice.release() openoffice.release()
metadata = json.loads(decodestring(stdout)) metadata = json.loads(decodestring(stdout))
if metadata.get("Data"): if 'document_url' in metadata:
self.document.reload(metadata['Data']) self.document.reload(metadata['document_url'])
metadata['Data'] = self.document.getContent() metadata['Data'] = self.document.getContent()
del metadata['document_url']
self.document.trash() self.document.trash()
return metadata return metadata
......
...@@ -337,7 +337,7 @@ def main(): ...@@ -337,7 +337,7 @@ def main():
output = encodestring(json.dumps(metadata_dict)) output = encodestring(json.dumps(metadata_dict))
elif '--getmetadata' in param_list and '--convert' in param_list: elif '--getmetadata' in param_list and '--convert' in param_list:
metadata_dict = unoconverter.getMetadata() metadata_dict = unoconverter.getMetadata()
metadata_dict['Data'] = unoconverter.convert() metadata_dict['document_url'] = unoconverter.convert()
output = encodestring(json.dumps(metadata_dict)) output = encodestring(json.dumps(metadata_dict))
elif '--setmetadata' in param_list: elif '--setmetadata' in param_list:
unoconverter.setMetadata(metadata) unoconverter.setMetadata(metadata)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment