formatted json transcript

This commit is contained in:
2019-02-20 12:03:42 -05:00
parent 226c645a6b
commit d5ce3d6583
2 changed files with 4 additions and 4 deletions

View File

@@ -6,7 +6,7 @@ with open('README.md') as file:
setup(
name="tatt",
version="0.947",
version="0.949",
py_modules=['tatt'],
url='https://github.com/zevaverbach/tatt',
install_requires=[

View File

@@ -19,17 +19,17 @@ def cli():
def get(name, save):
"""Downloads and/or saves completed transcript."""
try:
transcript = helpers.get_transcript(name)
transcript = json.dumps(helpers.get_transcript(name), indent=4)
except exceptions.DoesntExistError:
raise click.ClickException(f'no such transcript {name}')
except exceptions.NotAvailable as e:
raise click.ClickException(str(e))
if not save:
pprint(transcript)
click.echo(transcript)
else:
with open(f'{name}.json', 'w') as fout:
fout.write(json.dumps(transcript))
fout.write(transcript)
click.echo(f'Okay, downloaded {name}.json')