Remove filepath input for xml config
Uploading local configs is the way to go
This commit is contained in:
parent
62da620e74
commit
2291fac44c
@ -7,6 +7,7 @@ from bokeh.io import curdoc
|
|||||||
from bokeh.layouts import column, row
|
from bokeh.layouts import column, row
|
||||||
from bokeh.models import (
|
from bokeh.models import (
|
||||||
Button,
|
Button,
|
||||||
|
Div,
|
||||||
FileInput,
|
FileInput,
|
||||||
Panel,
|
Panel,
|
||||||
RadioButtonGroup,
|
RadioButtonGroup,
|
||||||
@ -21,8 +22,8 @@ import pyzebra
|
|||||||
def create():
|
def create():
|
||||||
config = pyzebra.AnatricConfig()
|
config = pyzebra.AnatricConfig()
|
||||||
|
|
||||||
def fileinput_callback(_attr, _old, new):
|
def _load_config_file(file):
|
||||||
config.load_from_file(new)
|
config.load_from_file(file)
|
||||||
|
|
||||||
logfile_textinput.value = config.logfile
|
logfile_textinput.value = config.logfile
|
||||||
logfile_verbosity_select.value = config.logfile_verbosity
|
logfile_verbosity_select.value = config.logfile_verbosity
|
||||||
@ -94,12 +95,11 @@ def create():
|
|||||||
minPeakCount_textinput.disabled = disable_adaptivedynamic
|
minPeakCount_textinput.disabled = disable_adaptivedynamic
|
||||||
displacementCurve_textinput.disabled = disable_adaptivedynamic
|
displacementCurve_textinput.disabled = disable_adaptivedynamic
|
||||||
|
|
||||||
fileinput = TextInput(title="Path to XML configuration file:", width=600)
|
upload_div = Div(text="Open XML configuration file:")
|
||||||
fileinput.on_change("value", fileinput_callback)
|
|
||||||
|
|
||||||
def upload_button_callback(_attr, _old, new):
|
def upload_button_callback(_attr, _old, new):
|
||||||
with io.BytesIO(base64.b64decode(new)) as file:
|
with io.BytesIO(base64.b64decode(new)) as file:
|
||||||
fileinput_callback(None, None, file)
|
_load_config_file(file)
|
||||||
|
|
||||||
upload_button = FileInput(accept=".xml")
|
upload_button = FileInput(accept=".xml")
|
||||||
upload_button.on_change("value", upload_button_callback)
|
upload_button.on_change("value", upload_button_callback)
|
||||||
@ -361,7 +361,7 @@ def create():
|
|||||||
|
|
||||||
tab_layout = row(
|
tab_layout = row(
|
||||||
column(
|
column(
|
||||||
fileinput,
|
upload_div,
|
||||||
upload_button,
|
upload_button,
|
||||||
row(logfile_textinput, logfile_verbosity_select),
|
row(logfile_textinput, logfile_verbosity_select),
|
||||||
row(filelist_type, filelist_format_textinput),
|
row(filelist_type, filelist_format_textinput),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user