Skip to content

Commit

Permalink
Added client name to auto-detected clients
Browse files Browse the repository at this point in the history
  • Loading branch information
girgink committed Nov 23, 2023
1 parent 5172395 commit 330570a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/fairly/client/dataverse.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def get_client(cls, url: str) -> Client:
raise ValueError("Invalid repository")

logging.info("Repository found at %s.", api_url)
client = DataverseClient(url=url, api_url=api_url)
client = DataverseClient(name=parts.hostname, url=url, api_url=api_url)

return client

Expand Down
1 change: 1 addition & 0 deletions src/fairly/client/figshare.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ def get_client(cls, url: str) -> Client:

parts = urlparse(url)
client = FigshareClient(
name=parts.hostname,
url=parts.scheme + "://" + parts.netloc,
api_url="https://api.figshare.com/v2/"
)
Expand Down
2 changes: 1 addition & 1 deletion src/fairly/client/invenio.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def get_client(cls, url: str) -> Client:
raise ValueError("Invalid repository")

logging.info("Repository found at %s.", api_url)
client = InvenioClient(url=url, api_url=api_url)
client = InvenioClient(name=parts.hostname, url=url, api_url=api_url)

return client

Expand Down

0 comments on commit 330570a

Please sign in to comment.