Skip to content

Commit

Permalink
make credential_file depended on a path
Browse files Browse the repository at this point in the history
  • Loading branch information
loechel committed Apr 23, 2024
1 parent a8feb00 commit 7a327e5
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions src/edutap/wallet_google/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,21 @@ def save_url(self) -> str:

@property
def credentials_file(self) -> Path | None:
if os.environ.get("EDUTAP_WALLET_GOOGLE_CREDENTIALS_FILE"):
path = Path(
Path(os.environ.get("CREDENTIAL_PATH", "."))
/ Path(
os.environ.get(
"EDUTAP_WALLET_GOOGLE_CREDENTIALS_FILE", "credential_file.json"
if getattr(self, "_credentials_file", None) is None:
self._credentials_file = None
if os.environ.get("EDUTAP_WALLET_GOOGLE_CREDENTIALS_FILE"):
path = Path(
Path(os.environ.get("CREDENTIAL_PATH", "."))
/ Path(
os.environ.get(
"EDUTAP_WALLET_GOOGLE_CREDENTIALS_FILE",
"credential_file.json",
)
)
)
)
if path.exists():
return path
return None
if path.exists():
self._credentials_file = path
return self._credentials_file

@property
def credentials_info(self) -> dict[str, str]:
Expand Down

0 comments on commit 7a327e5

Please sign in to comment.