3from textual.screen
import ModalScreen
4from textual.app
import ComposeResult
5from textual.widgets
import Input, Label
6from textual.containers
import Container
10from daqconf.cider.widgets.configuration_controller
import ConfigurationController
13 css_file_path = f
"{environ.get('DAQCONF_SHARE')}/config/textual_dbe/textual_css"
15 CSS_PATH = f
"{css_file_path}/edit_cell_layout.tcss"
18 self, event: Any, name: str |
None =
None, id: str |
None =
None, classes: str |
None =
None) ->
None:
19 super().
__init__(name=name, id=id, classes=classes)
20 """Screen which pops up when a cell is clicked in the ConfigTable
24 main_screen = self.app.get_screen(
"main")
32 self.
_controller = main_screen.query_one(ConfigurationController)
35 with Container(id=
"edit_cell"):
36 yield Label(f
"Enter new value for {self._current_row[0]}")
40 """Finds the cell that was clicked and populates the input field
42 cell_input = self.query_one(Input)
48 """Applies update to the configuration object
51 event -- Information from table row
54 update_value = event.value
64 self.
_controller.update_configuration(attr_name, update_value)
72 """Attempt to enforce type-checking/convertion on input variable based on type-name in table. Will not work for non-built-in types
75 return getattr(__builtins__, data_type)(input_variable)
81 """Processing required to ensure multi-variate objects are correctly placed in the table
85 input_value = input_value.replace(
"[",
"")
86 input_value = input_value.replace(
"]",
"")
88 input_value = input_value.replace(
" ",
"")
None on_input_submitted(self, Input.Submitted event)
process_multivalue_input(cls, str input_value, str data_type)
None __init__(self, Any event, str|None name=None, str|None id=None, str|None classes=None)
cast_to_type_by_str(cls, str input_variable, str data_type)
ComposeResult compose(self)