Spaces:
Runtime error
Runtime error
Hannes Kath commited on
Commit ·
5089f70
1
Parent(s): 84d5fa8
Test
Browse files
app.py
CHANGED
|
@@ -8,9 +8,7 @@ import dash_bootstrap_components as dbc
|
|
| 8 |
from dash import callback, dcc, html, Input, Output, State
|
| 9 |
|
| 10 |
|
| 11 |
-
|
| 12 |
-
if __name__ == '__main__':
|
| 13 |
-
print('Start: ', datetime.datetime.now())
|
| 14 |
gauth = GoogleAuth()
|
| 15 |
drive = GoogleDrive(gauth)
|
| 16 |
|
|
@@ -21,11 +19,13 @@ if __name__ == '__main__':
|
|
| 21 |
print("List of Folders:")
|
| 22 |
for folder in folder_list:
|
| 23 |
print("Folder Name:", folder['title'], "Folder ID:", folder['id'])
|
|
|
|
| 24 |
|
| 25 |
|
| 26 |
-
print(drive)
|
| 27 |
|
| 28 |
-
|
|
|
|
|
|
|
| 29 |
dash_app = dash.Dash(__name__,
|
| 30 |
external_stylesheets=[dbc.themes.BOOTSTRAP])
|
| 31 |
|
|
@@ -45,14 +45,13 @@ if __name__ == '__main__':
|
|
| 45 |
def Google_drive_authentication(n_clicks):
|
| 46 |
callback_trigger = dash.callback_context.triggered_id
|
| 47 |
if callback_trigger == 'button_authenticate':
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
return f'Number clicks: {auth_url}'
|
| 51 |
else:
|
| 52 |
return 'WAIT FOR CLICK'
|
| 53 |
|
| 54 |
|
| 55 |
-
dash_app.run_server(debug=True)
|
| 56 |
-
|
| 57 |
-
|
| 58 |
|
|
|
|
| 8 |
from dash import callback, dcc, html, Input, Output, State
|
| 9 |
|
| 10 |
|
| 11 |
+
def google_authentication():
|
|
|
|
|
|
|
| 12 |
gauth = GoogleAuth()
|
| 13 |
drive = GoogleDrive(gauth)
|
| 14 |
|
|
|
|
| 19 |
print("List of Folders:")
|
| 20 |
for folder in folder_list:
|
| 21 |
print("Folder Name:", folder['title'], "Folder ID:", folder['id'])
|
| 22 |
+
return 'YES'
|
| 23 |
|
| 24 |
|
|
|
|
| 25 |
|
| 26 |
+
if __name__ == '__main__':
|
| 27 |
+
print('Start: ', datetime.datetime.now())
|
| 28 |
+
|
| 29 |
dash_app = dash.Dash(__name__,
|
| 30 |
external_stylesheets=[dbc.themes.BOOTSTRAP])
|
| 31 |
|
|
|
|
| 45 |
def Google_drive_authentication(n_clicks):
|
| 46 |
callback_trigger = dash.callback_context.triggered_id
|
| 47 |
if callback_trigger == 'button_authenticate':
|
| 48 |
+
output = google_authentication()
|
| 49 |
+
return f'Number clicks: {output}'
|
|
|
|
| 50 |
else:
|
| 51 |
return 'WAIT FOR CLICK'
|
| 52 |
|
| 53 |
|
| 54 |
+
#dash_app.run_server(debug=True)
|
| 55 |
+
dash_app.run_server(debug=True, host='0.0.0.0', port=7860)
|
| 56 |
+
|
| 57 |
|