Spaces:
Sleeping
Sleeping
toks
Browse files- app.py +1 -29
- processing/cloud_access.py +1 -0
app.py
CHANGED
@@ -17,8 +17,6 @@ from processing.barsplots_rootcauses import check_classification
|
|
17 |
from processing.cloud_access import auto_download
|
18 |
|
19 |
sprint_data_folder = "Messungen"
|
20 |
-
password = os.getenv("Password")
|
21 |
-
seafile_token = os.getenv("seafile_token")
|
22 |
|
23 |
|
24 |
def get_csv_files(data_folder):
|
@@ -29,31 +27,6 @@ def get_csv_files(data_folder):
|
|
29 |
csv_files.append(csv_file)
|
30 |
return csv_files
|
31 |
|
32 |
-
def check_password():
|
33 |
-
"""Returns `True` if the user had the correct password."""
|
34 |
-
|
35 |
-
def password_entered():
|
36 |
-
"""Checks whether a password entered by the user is correct."""
|
37 |
-
if hmac.compare_digest(st.session_state["password"], password):
|
38 |
-
st.session_state["password_correct"] = True
|
39 |
-
del st.session_state["password"] # Don't store the password.
|
40 |
-
else:
|
41 |
-
st.session_state["password_correct"] = False
|
42 |
-
|
43 |
-
# Return True if the password is validated.
|
44 |
-
if st.session_state.get("password_correct", False):
|
45 |
-
return True
|
46 |
-
|
47 |
-
# Show input for password.
|
48 |
-
st.text_input(
|
49 |
-
"Password", type="password", on_change=password_entered, key="password"
|
50 |
-
)
|
51 |
-
if "password_correct" in st.session_state:
|
52 |
-
st.error("😕 Password incorrect")
|
53 |
-
return False
|
54 |
-
|
55 |
-
if not check_password():
|
56 |
-
st.stop() # Do not continue if check_password is not True.
|
57 |
|
58 |
|
59 |
def main():
|
@@ -149,9 +122,8 @@ def main():
|
|
149 |
|
150 |
if __name__ == "__main__":
|
151 |
main()
|
152 |
-
|
153 |
|
154 |
-
t1 = threading.Thread(target=auto_download(
|
155 |
t1.start()
|
156 |
|
157 |
|
|
|
17 |
from processing.cloud_access import auto_download
|
18 |
|
19 |
sprint_data_folder = "Messungen"
|
|
|
|
|
20 |
|
21 |
|
22 |
def get_csv_files(data_folder):
|
|
|
27 |
csv_files.append(csv_file)
|
28 |
return csv_files
|
29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
|
31 |
|
32 |
def main():
|
|
|
122 |
|
123 |
if __name__ == "__main__":
|
124 |
main()
|
|
|
125 |
|
126 |
+
t1 = threading.Thread(target=auto_download())
|
127 |
t1.start()
|
128 |
|
129 |
|
processing/cloud_access.py
CHANGED
@@ -32,6 +32,7 @@ def seafile_download_file(seafile_token, library_id, folder_path, file, target_f
|
|
32 |
|
33 |
def auto_download(seafile_token):
|
34 |
|
|
|
35 |
library_id = "a6911db9-9ec6-42d3-9c2f-ce36b121c5e7"
|
36 |
folder_path = "Messungen"
|
37 |
target_folder = "Messungen"
|
|
|
32 |
|
33 |
def auto_download(seafile_token):
|
34 |
|
35 |
+
seafile_token = "4cc2946501b19d995fed6a663989cd3d808d6660"
|
36 |
library_id = "a6911db9-9ec6-42d3-9c2f-ce36b121c5e7"
|
37 |
folder_path = "Messungen"
|
38 |
target_folder = "Messungen"
|