David Li commited on
Commit
fa6dbbc
·
1 Parent(s): fba7a0d

feat: update pages

Browse files
Files changed (3) hide show
  1. app.py +11 -0
  2. pages/ta.py +0 -10
  3. pages/utils/util.py +1 -1
app.py CHANGED
@@ -1,4 +1,15 @@
1
  import streamlit as st
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  st.write("""
4
  # Technical Analysis Web Application
 
1
  import streamlit as st
2
+ import os
3
+
4
+ stream = os.popen('cd ~ && pwd')
5
+ root_dir = stream.read()
6
+ # check for .openbb_terminal/env in root_dir
7
+ if os.path.exists(os.path.join(root_dir.strip(), ".openbb_terminal", ".env")) == False:
8
+ print("Did not find .openbb_terminal/.env")
9
+ # create it
10
+ os.mkdir(os.path.join(root_dir.strip(), ".openbb_terminal"))
11
+ # make .env file
12
+ env_file = open(os.path.join(root_dir.strip(), ".openbb_terminal", ".env"), "w")
13
 
14
  st.write("""
15
  # Technical Analysis Web Application
pages/ta.py CHANGED
@@ -9,16 +9,6 @@ from pages.utils.util import remove_existing_file
9
  from openbb_terminal.stocks.stocks_helper import load
10
  from openbb_terminal.common.technical_analysis.volatility_view import display_bbands, display_donchian
11
 
12
- stream = os.popen('cd ~ && pwd')
13
- root_dir = stream.read()
14
- # check for .openbb_terminal/env in root_dir
15
- if os.path.exists(os.path.join(root_dir.strip(), ".openbb_terminal", ".env")) == False:
16
- print("Did not find .openbb_terminal/.env")
17
- # create it
18
- os.mkdir(os.path.join(root_dir.strip(), ".openbb_terminal"))
19
- # make .env file
20
- env_file = open(os.path.join(root_dir.strip(), ".openbb_terminal", ".env"), "w")
21
-
22
  st.write("""
23
  # Technical Analysis Web Application
24
  Leveraging the openbb sdk, we can build a web application to display
 
9
  from openbb_terminal.stocks.stocks_helper import load
10
  from openbb_terminal.common.technical_analysis.volatility_view import display_bbands, display_donchian
11
 
 
 
 
 
 
 
 
 
 
 
12
  st.write("""
13
  # Technical Analysis Web Application
14
  Leveraging the openbb sdk, we can build a web application to display
pages/utils/util.py CHANGED
@@ -6,7 +6,7 @@ from io import StringIO
6
  def remove_existing_file(func):
7
  def wrapper(*args, **kwargs):
8
  old_stdin = sys.stdin
9
- sys.stdin = StringIO("y")
10
  stream = os.popen('cd ~ && pwd')
11
  root_dir = stream.read()
12
  sample_dir = root_dir.strip()
 
6
  def remove_existing_file(func):
7
  def wrapper(*args, **kwargs):
8
  old_stdin = sys.stdin
9
+ sys.stdin = StringIO("\n")
10
  stream = os.popen('cd ~ && pwd')
11
  root_dir = stream.read()
12
  sample_dir = root_dir.strip()