Skip to content

Commit

Permalink
fix: fix some typing issues
Browse files Browse the repository at this point in the history
  • Loading branch information
kmontag committed Aug 19, 2024
1 parent 0eb913f commit b396ad7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ __ext__/System_MIDIRemoteScripts/.make.decompile: $(SYSTEM_MIDI_REMOTE_SCRIPTS_D
.make.install: pyproject.toml poetry.lock
@if [ -z $(POETRY) ]; then echo "Poetry could not be found. See https://python-poetry.org/docs/"; exit 2; fi
$(POETRY) install
touch $@
touch $@
7 changes: 5 additions & 2 deletions control_surface/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,19 +294,22 @@ def override_nav(


def _override_elements_with_nav(
# Names of elements representing each direction.
left: str,
right: str,
up: str,
down: str,
# Nav to apply in the horizontal/vertical directions, or None if no nav should be specified.
horizontal: Optional[NavigationTarget],
vertical: Optional[NavigationTarget],
) -> List[ElementOverride]:
results: List[ElementOverride] = []
for down_element, up_element, target in (
elements_and_targets: Iterable[Tuple[str, str, Optional[NavigationTarget]]] = (
(left, right, horizontal),
# The down button increases values - think selected scene.
(up, down, vertical),
):
)
for down_element, up_element, target in elements_and_targets:
# Get a unique control name based on an element name.
def background_control_name(element: str):
return element.replace("[", "_").replace("]", "_")
Expand Down
5 changes: 3 additions & 2 deletions control_surface/mappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,12 +456,13 @@ def _navigation_mode(
vertical_target: Optional[NavigationTarget],
) -> List[SimpleModeSpecification]:
component_mappings: Dict[str, Dict[str, str]] = {}
for navigation_target, down_button, up_button in (
targets_and_elements: Iterable[Tuple[Optional[NavigationTarget], str, str]] = (
(horizontal_target, "nav_left_button", "nav_right_button"),
# The down button generally increases values, e.g. the selected scene index,
# session ring position...
(vertical_target, "nav_up_button", "nav_down_button"),
):
)
for navigation_target, down_button, up_button in targets_and_elements:
if navigation_target:
component, down_attribute, up_attribute = NAVIGATION_TARGET_MAPPINGS[
navigation_target
Expand Down

0 comments on commit b396ad7

Please sign in to comment.