diff --git a/src/release/json_dumps.py b/src/release/json_dumps.py new file mode 100755 index 0000000..5adefa6 --- /dev/null +++ b/src/release/json_dumps.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +import sys +import json +from common import loadData +from common import saveFile + +jsonFile = 'xxrs.json' + + +def jsonRelease(metadata: dict, content: dict) -> str: + return json.dumps({ + 'metadata': metadata, + 'content': content, + }, separators = (',', ':')) + + +if __name__ == '__main__': + data = loadData(sys.argv[1]) + saveFile(jsonFile, jsonRelease(data['metadata'], data['content'])) diff --git a/src/release/to_txt.py b/src/release/release_txt.py similarity index 88% rename from src/release/to_txt.py rename to src/release/release_txt.py index bd717cc..d148554 100755 --- a/src/release/to_txt.py +++ b/src/release/release_txt.py @@ -25,6 +25,4 @@ def txtRelease(metadata: dict, content: dict) -> str: if __name__ == '__main__': data = loadData(sys.argv[1]) - saveFile( - txtFile, txtRelease(data['metadata'], data['content']) - ) + saveFile(txtFile, txtRelease(data['metadata'], data['content'])) diff --git a/src/release/to_json.py b/src/release/to_json.py deleted file mode 100644 index 147d057..0000000 --- a/src/release/to_json.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -import sys -import json -from common import loadData - - -def jsonRelease(metadata: dict, content: dict) -> str: - return json.dumps( - { - 'metadata': metadata, - 'content': content, - }, separators = (',', ':') - ) - - -if __name__ == '__main__': - data = loadData(sys.argv[1]) - print(jsonRelease(data['metadata'], data['content']))