Code indexing in gitaly is broken and leads to code not being visible to the user. We work on the issue with highest priority.

Skip to content
Snippets Groups Projects
Commit 4d71abf6 authored by usov_i's avatar usov_i
Browse files

Display only filenames from a cami file

parent 9412de17
No related branches found
No related tags found
No related merge requests found
import base64 import base64
import io import io
import os
import numpy as np import numpy as np
from bokeh.layouts import column, gridplot, row from bokeh.layouts import column, gridplot, row
...@@ -26,6 +27,7 @@ from bokeh.models import ( ...@@ -26,6 +27,7 @@ from bokeh.models import (
Rect, Rect,
ResetTool, ResetTool,
Select, Select,
Spacer,
Spinner, Spinner,
TextAreaInput, TextAreaInput,
Title, Title,
...@@ -44,13 +46,11 @@ def create(): ...@@ -44,13 +46,11 @@ def create():
det_data = {} det_data = {}
roi_selection = {} roi_selection = {}
upload_div = Div(text="Open .cami file:")
def upload_button_callback(_attr, _old, new): def upload_button_callback(_attr, _old, new):
with io.StringIO(base64.b64decode(new).decode()) as file: with io.StringIO(base64.b64decode(new).decode()) as file:
h5meta_list = pyzebra.parse_h5meta(file) h5meta_list = pyzebra.parse_h5meta(file)
file_list = h5meta_list["filelist"] file_list = h5meta_list["filelist"]
filelist.options = file_list filelist.options = [(entry, os.path.basename(entry)) for entry in file_list]
filelist.value = file_list[0] filelist.value = file_list[0]
upload_button = FileInput(accept=".cami") upload_button = FileInput(accept=".cami")
...@@ -451,12 +451,15 @@ def create(): ...@@ -451,12 +451,15 @@ def create():
gridplot( gridplot(
[[overview_plot_x, overview_plot_y]], toolbar_options=dict(logo=None), merge_tools=True, [[overview_plot_x, overview_plot_y]], toolbar_options=dict(logo=None), merge_tools=True,
), ),
frame_button_group, row(frame_button_group),
) )
upload_div = Div(text="Upload .cami file:")
tab_layout = row( tab_layout = row(
column( column(
upload_div, upload_button, filelist, layout_image, row(colormap_layout, hkl_layout), row(column(Spacer(height=5), upload_div), upload_button, filelist),
layout_image,
row(colormap_layout, hkl_layout),
), ),
column(roi_avg_plot, layout_overview, row(selection_button, selection_list),), column(roi_avg_plot, layout_overview, row(selection_button, selection_list),),
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment