Skip to content

Commit

Permalink
code fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dvolgyes committed Feb 18, 2020
1 parent a0d7be3 commit 3dfbfdd
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions blackref/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ def formatter(bib, display_order, sort):

for entry in bib.entries:
entry = fix_isbn(entry)
entry = fix_issn(entry)
entry = fix_pages(entry)
for key in entry.keys():
entry[key] = fix_wrap(entry[key], key, indent=max_key_length)
Expand Down Expand Up @@ -228,12 +229,5 @@ def __exit__(self, *exc):
with lazy_open(args.src, "rt") as fh:
bib = bibtexparser.loads(fh.read())

if args.writeback or args.output:
if args.output is None:
if args.writeback:
args.output = args.src
else:
args.output = sys.stderr

with lazy_open(args.output, "wt") as f:
f.write(formatter(bib, args.display_order, args.sort))
with lazy_open(args.output, "wt") as f:
f.write(formatter(bib, args.display_order, args.sort))

0 comments on commit 3dfbfdd

Please sign in to comment.