thinh-vu commited on
Commit
0d009b1
1 Parent(s): b48f971

Update init.py

Browse files
Files changed (1) hide show
  1. init.py +9 -28
init.py CHANGED
@@ -18,14 +18,19 @@ def core_engine_setup():
18
  # Replace <token> with the environment variable for your GitHub PAT
19
  secure_url = repo_url.replace("<token>", git_token).replace("<user>", git_user).replace("<repo>", secure_repo)
20
  # subprocess.run(f"pip install git+{secure_url}", shell=True, check=True)
21
- subprocess.run(["git", "clone", secure_url])
 
 
22
 
23
  try:
24
  core_engine_setup()
25
- os.chdir(secure_repo)
26
  print('The core engine initialized successfully!')
27
- subprocess.run(f"ls -l", shell=True, check=True)
28
- subprocess.run(f"pip install -r requirements.txt", shell=True, check=True)
 
 
 
 
29
 
30
  from datetime import datetime, timedelta
31
  from app import chart, account
@@ -33,7 +38,6 @@ try:
33
  from app.config import *
34
 
35
  st.columns([2.5, 2, 1])[1].image('https://vnstock.site/wp-content/uploads/2023/07/vnstock-logo-120x60.jpg', width=120)
36
- st.columns([1.7, 2, 1])[1].markdown('### Dữ liệu & phân tích chứng khoán')
37
 
38
  technial_tab, account_tab = st.tabs(['Đồ thị kỹ thuật', 'Tài khoản'])
39
 
@@ -41,29 +45,6 @@ try:
41
  chart.render()
42
  with account_tab:
43
  account.render()
44
-
45
-
46
- # from app import technical_tab
47
- # from authen import authorize
48
-
49
- # center_col = st.columns([1, 3, 1])[1]
50
-
51
- # with center_col:
52
- # # st.image('https://vnstock.site/wp-content/uploads/2023/07/vnstock-logo-120x60.jpg', width=120)
53
- # auth, conf = authorize.load_config()
54
- # auth.login()
55
-
56
- # if st.session_state["authentication_status"]:
57
- # chart_tab, account_tab = st.tabs(['Home', 'Account'])
58
-
59
- # with chart_tab:
60
- # technical_tab.render()
61
-
62
- # with account_tab:
63
- # st.write(f'Xin chào *{st.session_state["name"]}*!')
64
- # st.markdown('### Đăng xuất')
65
- # auth.logout('Đăng xuất')
66
-
67
 
68
  except Exception as e:
69
  st.warning('Something went wrong! Please try again!')
 
18
  # Replace <token> with the environment variable for your GitHub PAT
19
  secure_url = repo_url.replace("<token>", git_token).replace("<user>", git_user).replace("<repo>", secure_repo)
20
  # subprocess.run(f"pip install git+{secure_url}", shell=True, check=True)
21
+ if not os.path.isdir(secure_repo):
22
+ subprocess.run(["git", "clone", secure_url], check=True)
23
+ os.chdir(secure_repo)
24
 
25
  try:
26
  core_engine_setup()
 
27
  print('The core engine initialized successfully!')
28
+ # subprocess.run(f"ls -l", shell=True, check=True)
29
+ if not os.path.isfile("requirements_installed.txt"):
30
+ subprocess.run(["pip", "install", "-r", "requirements.txt"], check=True)
31
+ # Create a file indicating requirements have been installed
32
+ with open("requirements_installed.txt", "w") as f:
33
+ f.write("Requirements installed.")
34
 
35
  from datetime import datetime, timedelta
36
  from app import chart, account
 
38
  from app.config import *
39
 
40
  st.columns([2.5, 2, 1])[1].image('https://vnstock.site/wp-content/uploads/2023/07/vnstock-logo-120x60.jpg', width=120)
 
41
 
42
  technial_tab, account_tab = st.tabs(['Đồ thị kỹ thuật', 'Tài khoản'])
43
 
 
45
  chart.render()
46
  with account_tab:
47
  account.render()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
 
49
  except Exception as e:
50
  st.warning('Something went wrong! Please try again!')