From b6fa9b35c2427db598ef7358295fb067ea69696f Mon Sep 17 00:00:00 2001 From: Dan Howe Date: Thu, 29 Aug 2019 08:12:23 +1000 Subject: [PATCH] Upload only one file --- daqviewer/daqviewer.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/daqviewer/daqviewer.py b/daqviewer/daqviewer.py index 8385886..95470a6 100644 --- a/daqviewer/daqviewer.py +++ b/daqviewer/daqviewer.py @@ -35,8 +35,8 @@ app.layout = html.Div([ 'textAlign': 'center', 'margin': '10px' }, - # Allow multiple files to be uploaded - multiple=True), + # Only upload one file + multiple=False), html.Div(id='output-data-upload'), ]) @@ -152,20 +152,16 @@ def parse_contents(contents, filename, date): return elements -@app.callback([Output('output-data-upload', 'children')], [ +@app.callback(Output('output-data-upload', 'children'), [ Input('upload-data', 'contents'), Input('upload-data', 'filename'), Input('upload-data', 'last_modified'), ]) -def update_output(contents, names, dates): +def update_output(contents, name, date): if contents is not None: - children = [ - parse_contents(c, n, d) for c, n, d in zip(contents, names, dates) - ] - - return children + return parse_contents(contents, name, date) else: - return [html.Div([])] + return html.Div([]) def main():