Skip to content

Commit 87f130d

Browse files
committed
Run ruff
1 parent fc2a678 commit 87f130d

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

src/config.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,23 @@
1717
college_code = "CI"
1818

1919
# Warn users if they have missing required environment variables
20-
environ_help_url = "https://github.com/Zohair-coder/drexel-scraper?tab=readme-ov-file#authentication"
20+
environ_help_url = (
21+
"https://github.com/Zohair-coder/drexel-scraper?tab=readme-ov-file#authentication"
22+
)
23+
24+
2125
def get_environ(key: str, required: bool = True) -> str:
2226
if key in os.environ:
2327
return os.environ[key]
2428
elif required:
25-
print(f"{key} is missing from your environment variables and is required to run this script. See {environ_help_url} for more information and help.")
29+
print(
30+
f"{key} is missing from your environment variables and is required to run this script. See {environ_help_url} for more information and help."
31+
)
2632
sys.exit(1)
2733
else:
2834
return ""
2935

36+
3037
# Drexel Connect Credentials
3138
drexel_username = get_environ("DREXEL_USERNAME")
3239
drexel_password = get_environ("DREXEL_PASSWORD")

src/totp.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,13 @@ def get_token(secret: str) -> str:
1616
h = (struct.unpack(">I", h[o : o + 4])[0] & 0x7FFFFFFF) % 1000000
1717
return str(h).zfill(6)
1818

19+
1920
if __name__ == "__main__":
2021
import config
22+
2123
if config.drexel_mfa_secret_key is not None:
2224
print(get_token(config.drexel_mfa_secret_key))
2325
else:
24-
print(f"Please set your MFA secret key to run this script. See {config.environ_help_url} for more information and help")
26+
print(
27+
f"Please set your MFA secret key to run this script. See {config.environ_help_url} for more information and help"
28+
)

0 commit comments

Comments
 (0)