Skip to content

Commit fcab64e

Browse files
committed
Utils covered
1 parent 8e287f4 commit fcab64e

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

src/ephys_link/front_end/gui.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from vbl_aquarium.models.ephys_link import EphysLinkOptions
2121

2222
from ephys_link.__about__ import __version__ as version
23-
from ephys_link.utils.startup import get_binding_display_to_cli_name
23+
from ephys_link.utils.startup import get_bindings
2424

2525
# Define options path.
2626
OPTIONS_DIR = join(user_config_dir(), "VBL", "Ephys Link")
@@ -156,7 +156,7 @@ def _build_gui(self) -> None:
156156
platform_type_settings = ttk.LabelFrame(mainframe, text="Platform Type", padding=3)
157157
platform_type_settings.grid(column=0, row=1, sticky="news")
158158

159-
for index, (display_name, cli_name) in enumerate(get_binding_display_to_cli_name().items()):
159+
for index, (display_name, cli_name) in enumerate(self._get_binding_display_to_cli_name().items()):
160160
ttk.Radiobutton(
161161
platform_type_settings,
162162
text=display_name,
@@ -202,3 +202,11 @@ def _launch_server(self) -> None:
202202
"""
203203
self._submit = True
204204
self._root.destroy()
205+
206+
def _get_binding_display_to_cli_name(self) -> dict[str, str]:
207+
"""Get mapping of display to CLI option names of the available platform bindings.
208+
209+
Returns:
210+
Dictionary of platform binding display name to CLI option name.
211+
"""
212+
return {binding_type.get_display_name(): binding_type.get_cli_name() for binding_type in get_bindings()}

src/ephys_link/utils/startup.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,3 @@ def get_binding_instance(options: EphysLinkOptions, console: Console) -> BaseBin
101101
error_message = unrecognized_platform_type_error(selected_type)
102102
console.critical_print(error_message)
103103
raise ValueError(error_message)
104-
105-
106-
def get_binding_display_to_cli_name() -> dict[str, str]:
107-
"""Get mapping of display to CLI option names of the available platform bindings.
108-
109-
Returns:
110-
Dictionary of platform binding display name to CLI option name.
111-
"""
112-
return {binding_type.get_display_name(): binding_type.get_cli_name() for binding_type in get_bindings()}

0 commit comments

Comments
 (0)