-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathinitialization.py
62 lines (47 loc) · 1.41 KB
/
initialization.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import os
import subprocess
import sys
root = os.path.dirname(__file__)
sys.path.append(root)
def install_modules():
for package in [
"jproperties",
"pandas",
"jira",
"jsonpath-ng",
"PyGithub",
"pyperclip",
"GitPython",
"textual",
]:
subprocess.check_call([sys.executable, "-m", "pip", "install", package])
def generate_credentials():
if os.path.exists(os.path.join(root, "credentials-ext.properties")) == False:
print("Creating credentials-ext.properties...")
with open(
os.path.join(root, "credentials.properties"), "r"
) as credentials, open(
os.path.join(root, "credentials-ext.properties"), "w"
) as credentials_ext:
credentials_content = credentials.readlines()
for line in range(7, len(credentials_content)):
credentials_ext.write(credentials_content[line])
print("credentials-ext.properties is created")
def upgrade_modules():
for package in [
"jproperties",
"pandas",
"jira",
"jsonpath-ng",
"PyGithub",
"pyperclip",
"GitPython",
"textual",
]:
subprocess.check_call(
[sys.executable, "-m", "pip", "install", "--upgrade", package]
)
if __name__ == "__main__":
install_modules()
upgrade_modules()
generate_credentials()