@@ -16,7 +16,9 @@ def check_python_installed():
16
16
Function to check if Python is installed.
17
17
"""
18
18
try :
19
- subprocess .run ([sys .executable , "--version" ], check = True , capture_output = True , text = True )
19
+ subprocess .run (
20
+ [sys .executable , "--version" ], check = True , capture_output = True , text = True
21
+ )
20
22
print ("Python is already installed." )
21
23
return True
22
24
except FileNotFoundError :
@@ -66,7 +68,9 @@ def install_python(installer_path):
66
68
return
67
69
print ("Initiating Python installation..." )
68
70
try :
69
- subprocess .run ([installer_path , "/quiet" , "InstallAllUsers=1" , "PrependPath=1" ], check = True )
71
+ subprocess .run (
72
+ [installer_path , "/quiet" , "InstallAllUsers=1" , "PrependPath=1" ], check = True
73
+ )
70
74
print ("Python installation completed successfully." )
71
75
except Exception as e :
72
76
print (f"Error during Python installation: { e } " )
@@ -84,14 +88,18 @@ def clone_repo_if_not_exists(repo_url):
84
88
:rtype: None
85
89
"""
86
90
repo_name = "Logicytics"
87
- if not any (path .name == repo_name and path .is_dir () for path in script_dir .iterdir ()):
91
+ if not any (
92
+ path .name == repo_name and path .is_dir () for path in script_dir .iterdir ()
93
+ ):
88
94
try :
89
95
subprocess .run (["git" , "clone" , repo_url ], cwd = script_dir , check = True )
90
96
print (f"Repository { repo_name } cloned successfully." )
91
97
except Exception as e :
92
98
print (f"Failed to clone repository { repo_name } : { e } " )
93
99
else :
94
- print (f"The repository { repo_name } already exists in the current directory. Skipping clone." )
100
+ print (
101
+ f"The repository { repo_name } already exists in the current directory. Skipping clone."
102
+ )
95
103
96
104
97
105
# Main function
@@ -120,7 +128,12 @@ def main():
120
128
121
129
# Run pip install
122
130
try :
123
- result = subprocess .run (["pip" , "install" , "-e" , "." ], capture_output = True , text = True , check = True )
131
+ result = subprocess .run (
132
+ ["pip" , "install" , "-e" , "." ],
133
+ capture_output = True ,
134
+ text = True ,
135
+ check = True ,
136
+ )
124
137
with open ("Download.log" , "w" ) as log_file :
125
138
log_file .write (result .stdout )
126
139
@@ -142,4 +155,4 @@ def main():
142
155
143
156
144
157
if __name__ == "__main__" :
145
- main ()
158
+ main ()
0 commit comments