Skip to content

Commit

Permalink
Small quotation marks change
Browse files Browse the repository at this point in the history
  • Loading branch information
nheeb committed Sep 11, 2024
1 parent 39eb860 commit 6c23751
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/hermes/commands/init/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def __call__(self, args: argparse.Namespace) -> None:
# TODO Replace this with another link or package data
hermes_toml_raw_url = "https://raw.githubusercontent.com/nheeb/zenodo-test/main/hermes.toml"
download_file_from_url(hermes_toml_raw_url, os.path.join(os.getcwd(), "hermes.toml"))
sc.echo(f"hermes.toml was {"replaced" if self.folder_info.has_hermes_toml else "created"}.")
sc.echo(f"hermes.toml was {'replaced' if self.folder_info.has_hermes_toml else 'created'}.")

# Creating the citation File
if not self.folder_info.has_citation_cff:
Expand Down
6 changes: 2 additions & 4 deletions src/hermes/commands/init/oauth_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,14 @@ def open_browser(self, port : int = None) -> bool:
def get_tokens_from_refresh_token(self, refresh_token: str) -> dict[str: str]:
"""Returns access and refresh token as dict using a refresh token"""
oa_session = OAuth2Session(self.client_id, redirect_uri=self.redirect_uri, scope=self.scope)
token = oa_session.refresh_token(self.token_url, refresh_token=refresh_token, client_secret=self.client_secret,
return oa_session.refresh_token(self.token_url, refresh_token=refresh_token, client_secret=self.client_secret,
include_client_id=True, client_id=self.client_id)
return token

def get_tokens_from_auth_code(self, auth_code: str) -> dict[str: str]:
"""Returns access and refresh token as dict using an auth-code"""
oa_session = OAuth2Session(self.client_id, redirect_uri=self.redirect_uri, scope=self.scope)
token = oa_session.fetch_token(self.token_url, client_secret=self.client_secret, include_client_id=True,
return oa_session.fetch_token(self.token_url, client_secret=self.client_secret, include_client_id=True,
code=auth_code)
return token

def get_tokens(self) -> dict[str: str]:
server_thread = threading.Thread(target=self.start_server)
Expand Down

0 comments on commit 6c23751

Please sign in to comment.