Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
@@ -2,43 +2,32 @@ import subprocess
|
|
2 |
import os
|
3 |
import time
|
4 |
|
5 |
-
# Install required packages
|
6 |
subprocess.call(["pip", "install", "flet==0.19.0"])
|
7 |
subprocess.call(["pip", "install", "flet_fastapi==0.19.0"])
|
8 |
|
9 |
-
# Get GitHub token from environment variable
|
10 |
gh_token = os.getenv("gh_token")
|
11 |
|
12 |
-
# Construct GitHub URL with token for cloning
|
13 |
url_with_token = f"https://{gh_token}@github.com/Eslam-Magdy-1297/ESearch_FletV01.git"
|
14 |
|
15 |
-
# Clone the repository
|
16 |
os.system(f"git clone {url_with_token}")
|
17 |
|
18 |
-
# Wait for cloning to complete
|
19 |
time.sleep(10)
|
20 |
|
21 |
import subprocess
|
22 |
import os
|
23 |
import time
|
24 |
|
25 |
-
# Install required packages
|
26 |
subprocess.call(["pip", "install", "flet==0.19.0"])
|
27 |
subprocess.call(["pip", "install", "flet_fastapi==0.19.0"])
|
28 |
|
29 |
-
# Get GitHub token from environment variable
|
30 |
gh_token = os.getenv("gh_token")
|
31 |
|
32 |
-
# Construct GitHub URL with token for cloning
|
33 |
url_with_token = f"https://{gh_token}@github.com/Eslam-Magdy-1297/ESearch_FletV01.git"
|
34 |
|
35 |
-
# Clone the repository
|
36 |
os.system(f"git clone {url_with_token}")
|
37 |
|
38 |
-
# Wait for cloning to complete
|
39 |
time.sleep(10)
|
40 |
|
41 |
-
# Read and execute main.py code directly
|
42 |
with open("ESearch_FletV01/app.py", "r") as file:
|
43 |
code = file.read()
|
44 |
exec(code)
|
|
|
2 |
import os
|
3 |
import time
|
4 |
|
|
|
5 |
subprocess.call(["pip", "install", "flet==0.19.0"])
|
6 |
subprocess.call(["pip", "install", "flet_fastapi==0.19.0"])
|
7 |
|
|
|
8 |
gh_token = os.getenv("gh_token")
|
9 |
|
|
|
10 |
url_with_token = f"https://{gh_token}@github.com/Eslam-Magdy-1297/ESearch_FletV01.git"
|
11 |
|
|
|
12 |
os.system(f"git clone {url_with_token}")
|
13 |
|
|
|
14 |
time.sleep(10)
|
15 |
|
16 |
import subprocess
|
17 |
import os
|
18 |
import time
|
19 |
|
|
|
20 |
subprocess.call(["pip", "install", "flet==0.19.0"])
|
21 |
subprocess.call(["pip", "install", "flet_fastapi==0.19.0"])
|
22 |
|
|
|
23 |
gh_token = os.getenv("gh_token")
|
24 |
|
|
|
25 |
url_with_token = f"https://{gh_token}@github.com/Eslam-Magdy-1297/ESearch_FletV01.git"
|
26 |
|
|
|
27 |
os.system(f"git clone {url_with_token}")
|
28 |
|
|
|
29 |
time.sleep(10)
|
30 |
|
|
|
31 |
with open("ESearch_FletV01/app.py", "r") as file:
|
32 |
code = file.read()
|
33 |
exec(code)
|