Remove printing from parse function

master
Aaron Goldstein 2020-03-04 00:34:33 -08:00
parent 7c8e1dfa68
commit 5151cbad04
3 changed files with 12 additions and 7 deletions

1
.gitignore vendored
View File

@ -48,3 +48,4 @@ Temporary Items
/venv/
/.ipynb_checkpoints/
/.idea/
*.json

View File

@ -58,11 +58,8 @@ def parse(input, output, json_format, **kwargs):
schematic.pop("hierarchy", None)
if output:
json_file = open(output, 'w')
json.dump(schematic, json_file)
else:
print(schematic)
return schematic
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Converts Altium .SchDoc files into json.')
@ -74,4 +71,10 @@ if __name__ == "__main__":
help='Organize records into owner/child "hierarchy" or leave as a "flat" list.')
args = parser.parse_args()
parse(**vars(args))
schematic = parse(**vars(args))
if args.output:
json_file = open(args.output, 'w')
json.dump(schematic, json_file)
else:
print(schematic)

View File

@ -12,5 +12,6 @@ setup(
author='Aaron Goldstein',
author_email='aaronmgoldstein@gmail.com',
description='Converts Altium .SchDoc files into json',
long_description=long_description
long_description=long_description,
long_description_content_type="text/markdown"
)