| @@ 198-209 (lines=12) @@ | ||
| 195 | return html.Ul(html.Li("No Files Uploaded Yet!"), style={'textAlign': 'center'}) |
|
| 196 | ||
| 197 | ||
| 198 | @app.callback(Output('files_dropdown', 'options'), |
|
| 199 | [Input('upload','fileNames')]) |
|
| 200 | def dropdown_files(fileNames): |
|
| 201 | # time.sleep(5) |
|
| 202 | mypath='./uploads/' |
|
| 203 | onlyfiles = [f for f in listdir(mypath) if isfile(join(mypath, f))] |
|
| 204 | #print(onlyfiles) |
|
| 205 | #onlyfiles = [f for f in listdir(mypath) if isfile(join(mypath, f))] |
|
| 206 | #options=[{'label': i, 'value': i} for i in onlyfiles] |
|
| 207 | #print(options) |
|
| 208 | #return {'options':options} |
|
| 209 | return [{'label': i, 'value': i} for i in onlyfiles] |
|
| 210 | ||
| 211 | ||
| 212 | @app.callback( #update charge datatable |
|
| @@ 97-108 (lines=12) @@ | ||
| 94 | return html.Ul(html.Li("No Files Uploaded Yet!")) |
|
| 95 | ||
| 96 | ||
| 97 | @app.callback(Output('files_dropdown', 'options'), |
|
| 98 | [Input('upload','fileNames')]) |
|
| 99 | def dropdown_files(fileNames): |
|
| 100 | # time.sleep(5) |
|
| 101 | mypath='./uploads/' |
|
| 102 | onlyfiles = [f for f in listdir(mypath) if isfile(join(mypath, f))] |
|
| 103 | #print(onlyfiles) |
|
| 104 | #onlyfiles = [f for f in listdir(mypath) if isfile(join(mypath, f))] |
|
| 105 | #options=[{'label': i, 'value': i} for i in onlyfiles] |
|
| 106 | #print(options) |
|
| 107 | #return {'options':options} |
|
| 108 | return [{'label': i, 'value': i} for i in onlyfiles] |
|
| 109 | ||
| 110 | ||
| 111 | def parse_contents(value): |
|