(20260311) Cosec scripts can now accept custom file names for the credentials, but they must be in the same 'creds' directory.

This commit is contained in:
2026-03-11 11:23:52 +05:30
parent 0adb27bae3
commit e25daf5fd5
2 changed files with 26 additions and 4 deletions
+12 -2
View File
@@ -367,6 +367,16 @@ if __name__ == "__main__":
action = "store_true",
default = False,
)
ap.add_argument(
"--cosec-creds",
help = "The credentials JSON from which you would like to connect to COSEC.",
default = "cosec.json"
)
ap.add_argument(
"--tcaoff-creds",
help = "The credentials JSON from which you would like to connect to TheCAOffice.",
default = "tcaoff.json"
)
args = ap.parse_args()
# Explicitly mention the expected file paths for other devs to maintain:
@@ -375,8 +385,8 @@ if __name__ == "__main__":
print("TCAOFF CREDS:", common.TCAOFF_CREDS_FILE)
# Read required credentials:
cosec_creds = json.from_file(common.COSEC_CREDS_FILE)
tcaoff_creds = json.from_file(common.TCAOFF_CREDS_FILE)
cosec_creds = json.from_file(os.path.join(common.CREDS_DIR, args.cosec_creds))
tcaoff_creds = json.from_file(os.path.join(common.CREDS_DIR, args.tcaoff_creds))
# Create the clients:
tcaoff_client = AsyncTheCAOffice(