Skip to content

Commit

Permalink
manubot#337 Tag zotero timeouts.
Browse files Browse the repository at this point in the history
  • Loading branch information
xihh87 committed Jun 15, 2022
1 parent 20d6012 commit ff6f901
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions manubot/cite/zotero.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"""URL that provides access to the Zotero translation-server API"""


def web_query(url: str, timeout=3) -> ZoteroData:
def web_query(url: str, timeout: int = 3) -> ZoteroData:
"""
Return Zotero citation metadata for a URL as a list containing a single element that
is a dictionary with the URL's metadata.
Expand Down Expand Up @@ -54,7 +54,7 @@ def web_query(url: str, timeout=3) -> ZoteroData:
return zotero_data


def search_query(identifier: str, timeout=3) -> ZoteroData:
def search_query(identifier: str, timeout: int = 3) -> ZoteroData:
"""
Retrive Zotero metadata for a DOI, ISBN, PMID, or arXiv ID.
Example usage:
Expand Down Expand Up @@ -97,7 +97,7 @@ def _passthrough_zotero_data(zotero_data: ZoteroData) -> ZoteroData:
return zotero_data


def export_as_csl(zotero_data: ZoteroData, timeout=3) -> CSLItems:
def export_as_csl(zotero_data: ZoteroData, timeout: int = 3) -> CSLItems:
"""
Export Zotero JSON data to CSL JSON using a translation-server /export query.
Performs a similar query to the following curl command:
Expand Down Expand Up @@ -126,7 +126,7 @@ def export_as_csl(zotero_data: ZoteroData, timeout=3) -> CSLItems:
return csl_items


def get_csl_item(identifier: str, timeout=3) -> CSLItem:
def get_csl_item(identifier: str, timeout: int = 3) -> CSLItem:
"""
Use a translation-server search query followed by an export query
to return a CSL Item (the first & only record of the returned CSL JSON).
Expand All @@ -137,7 +137,7 @@ def get_csl_item(identifier: str, timeout=3) -> CSLItem:
return csl_item


def search_or_web_query(identifier: str, timeout=3) -> ZoteroData:
def search_or_web_query(identifier: str, timeout: int = 3) -> ZoteroData:
"""
Detect whether `identifier` is a URL. If so,
retrieve zotero metadata using a /web query.
Expand Down

0 comments on commit ff6f901

Please sign in to comment.