Skip to content

Commit 5b1c4fb

Browse files
committed
Adding more verbose statements for connecting to osw and credentials lookup
1 parent 7113947 commit 5b1c4fb

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

‎src/osw/auth.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,9 @@ def get_credential(self, config: CredentialConfig) -> BaseCredential:
168168

169169
if cred is None:
170170
if config.fallback is CredentialManager.CredentialFallback.ask:
171+
filepath_str = "', '".join([str(fp) for fp in self.cred_filepath])
171172
print(
172-
f"No credentials for {config.iri} found. "
173+
f"No credentials for {config.iri} found in path '{filepath_str}'. "
173174
f"Please use the prompt to login"
174175
)
175176
username = input("Enter username: ")

‎src/osw/express.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ def __init__(
135135
url = f"https://{domain}/wiki/Main_Page"
136136
response = requests.get(url)
137137
if response.status_code == 200:
138-
pass # Domain is reachable
138+
# Domain is reachable
139+
print(f"Connecting to '{domain}'...")
139140
else:
140141
raise ConnectionError(
141142
f"Could not connect to '{domain}'. "
@@ -147,6 +148,7 @@ def __init__(
147148
super().__init__(**{"site": site, "domain": domain})
148149
self.cred_mngr = cred_mngr
149150
self.cred_filepath = cred_filepath
151+
print(f"Connected to '{domain}'.")
150152

151153
def __enter__(self):
152154
"""Return self when entering the context manager."""

0 commit comments

Comments
 (0)