Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added verbose kwarg to check_arxiv_published #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions arxivcheck/arxiv.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def bibtex_error():
if firstnewline == -1:
bibtex_error()

bib = (bib[0:firstnewline] + '\n' +
bib = (bib[0:firstnewline] + '\n' +
' eprint={' + eprint + '},\n' +
' archiveprefix={arXiv},' +
bib[firstnewline:])
Expand Down Expand Up @@ -180,7 +180,7 @@ def get_arxiv_pdf_link(value, field="id"):


def check_arxiv_published(
value, field="id", get_first=True, keep_eprint=False):
value, field="id", get_first=True, keep_eprint=False, verbose=True):
"""

Parameters
Expand All @@ -191,8 +191,11 @@ def check_arxiv_published(
field used for the arxiv search API
get_first: bool
keep_eprint: bool
If True keep the arxiv number if the paper
If True keep the arxiv number if the paper
has already been published
verbose: bool
If True print message if arXiv item could
not be found

Returns
-------
Expand All @@ -218,7 +221,7 @@ def check_arxiv_published(
if title_arxiv == title:
items = [item_arxiv]
break

if get_first is False and field == "ti" and len(items) > 1:
found, item = ask_which_is(value, items)
else:
Expand All @@ -234,7 +237,7 @@ def check_arxiv_published(
else:
bib = generate_bib_from_arxiv(item, value, field)

else:
elif verbose:
print("\t\nArxiv not found.")

return found, published, bib