File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 1717college_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+
2125def 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
3138drexel_username = get_environ ("DREXEL_USERNAME" )
3239drexel_password = get_environ ("DREXEL_PASSWORD" )
Original file line number Diff line number Diff 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+
1920if __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+ )
You can’t perform that action at this time.
0 commit comments