Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def main(argv=None):
parser = _get_parser()
args = parser.parse_args(argv)
# Make sure that the entries are written out sorted by their BibTeX key if demanded.
data = bibtex.Parser().parse_file(args.infile)
tuples = data.entries.items()
if args.sort_by_bibkey:
tuples = sorted(data.entries.items())
d = dict(tuples)
d = sync(d, args.source, args.long_journal_names, args.num_concurrent_requests)
d = adapt_doi_urls(d, args.doi_url_type)
d = tools.sanitize_title(d)
d = journal_abbrev(d, args.long_journal_names, args.extra_abbrev_file)
tools.write(d, args.outfile, args.delimeter_type, tab_indent=args.tab_indent)
args = parser.parse_args(argv)
data = bibtex.Parser().parse_file(args.infile)
if args.drop:
data = tools.filter_fields(data, args.drop)
# Use an ordered dictionary to make sure that the entries are written out
# sorted by their BibTeX key if demanded.
tuples = data.entries.items()
if args.sort_by_bibkey:
tuples = sorted(data.entries.items())
d = dict(tuples)
d = adapt_doi_urls(d, args.doi_url_type)
tools.write(d, args.outfile, args.delimeter_type, tab_indent=args.tab_indent)