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

30 zotero #31

Merged
merged 3 commits into from
Apr 12, 2024
Merged
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
6 changes: 3 additions & 3 deletions src/panpdf/filters/zotero.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,18 @@
urls = [get_url_zotxt(key) for key in keys]

try:
asyncio.run(gather([urls[0]], get_csl))
asyncio.run(gather([urls[0]], get_csl_json))
except ClientError:
return None

return [ref for ref in asyncio.run(gather(urls, get_csl)) if ref]
return [ref for ref in asyncio.run(gather(urls, get_csl_json)) if ref]

Check warning on line 56 in src/panpdf/filters/zotero.py

View check run for this annotation

Codecov / codecov/patch

src/panpdf/filters/zotero.py#L56

Added line #L56 was not covered by tests


def get_url_zotxt(key: str, host: str = "localhost", port: int = 23119) -> str:
return f"http://{host}:{port}/zotxt/items?betterbibtexkey={key}"


async def get_csl(response: ClientResponse) -> dict:
async def get_csl_json(response: ClientResponse) -> dict:
if response.status != 200: # noqa: PLR2004
return {}

Expand Down