-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path__init__.py
34 lines (28 loc) · 922 Bytes
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import os
from src.auth import *
from src.commands import *
PROJECT_PATH = os.path.dirname(os.path.abspath(__file__))
config_path = os.path.join(PROJECT_PATH, "env.json")
check_config = os.path.isfile(config_path)
cfg_template = { "AA": {
"default_cr": "sbx",
"env_list": [
{
"name": "sbx",
"auth_type": "token",
"endpoint": "https://<<control_room>>.<<env>>.automationanywhere.digital",
"userid": "<<userid>>",
"api_key": "<<api_key>>"
}
]
}}
if check_config:
with open(config_path, "r") as f:
cfg = json.load(f)
else:
print(f"Config file not found at {config_path}")
print(f"Creating template at {PROJECT_PATH}/craapy_template.json")
with open(os.path.join(PROJECT_PATH, "craapy_template.json"), "w") as f:
# Writing tepmlate to PROJECT_PATH
f.write(json.dumps(cfg_template, indent=2))
CFG_FILE = cfg