From 5be2e9ae50f9358d16f14e09c2e7d51ec1dc8755 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Fri, 9 Mar 2018 16:17:11 +0100 Subject: Add setup.py for Pip/setuptools support --- bibtool/cli.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'bibtool/cli.py') diff --git a/bibtool/cli.py b/bibtool/cli.py index 3356d16..74855b9 100644 --- a/bibtool/cli.py +++ b/bibtool/cli.py @@ -37,7 +37,8 @@ def _import(filename, directory): if edited_data: bibtex_data = bibtexparser.loads(edited_data) if len(bibtex_data.entries) != 1: - raise Exception('The edited data must contain exactly one Bibtex entry.') + raise Exception('The edited data must contain exactly one' + 'Bibtex entry.') entry = bibtex_data.entries[0] click.confirm('Add {} to the repository?'.format(entry['ID']), @@ -46,7 +47,7 @@ def _import(filename, directory): bibfilename = os.path.join(directory, entry['ID'] + '.bib') outfileext = os.path.splitext(filename)[1] outfilename = os.path.join(directory, entry['ID'] + outfileext) - + if os.path.exists(bibfilename) or os.path.exists(outfilename): click.confirm('There is already a document with this ID in the ' 'repository. Continue anyway?', abort=True) -- cgit v1.2.1