Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
sassanh committed Nov 24, 2024
1 parent 253cab9 commit e336ade
Show file tree
Hide file tree
Showing 20 changed files with 1,211 additions and 588 deletions.
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ keywords = ['ubo', 'ubo-pod', 'raspberry pi', 'rpi', 'home assistance']
dependencies = [
"psutil >=6.0.0",
"ubo-gui >=0.13.7",
"headless-kivy >=0.12.1",
"headless-kivy >=0.12.2",
"pyzbar >=0.1.9",
"sdbus-networkmanager >=2.0.0 ; platform_machine=='aarch64'",
"rpi_ws281x >=5.0.0 ; platform_machine=='aarch64'",
Expand Down Expand Up @@ -166,7 +166,7 @@ multiline-quotes = "double"
[tool.ruff.lint.per-file-ignores]
"tests/*" = ["S101", "PLR0913", "PLR0915"]
"**/reducer.py" = ["C901", "PLR0912", "PLR0915"]
"ubo_app/services/*/ubo_handle.py" = ["TCH004"]
"ubo_app/services/*/ubo_handle.py" = ["TC004"]
"ubo_app/rpc/generated/*" = [
"ARG002",
"ASYNC109",
Expand All @@ -177,7 +177,7 @@ multiline-quotes = "double"
"F401",
"RUF009",
"SLF001",
"TCH001",
"TC001",
"TID252",
]

Expand Down
12 changes: 6 additions & 6 deletions tests/fixtures/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,12 +251,12 @@ def patched_config_set(category: str, key: str, value: str) -> None:
from ubo_app.display import render_on_display

headless_kivy.config.setup_headless_kivy(
{
'callback': render_on_display,
'flip_vertical': True,
'width': WIDTH,
'height': HEIGHT,
},
headless_kivy.config.SetupHeadlessConfig(
callback=render_on_display,
flip_vertical=True,
width=WIDTH,
height=HEIGHT,
),
)


Expand Down
4 changes: 3 additions & 1 deletion tests/fixtures/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import pytest
from tenacity import wait_fixed
from ubo_gui.page import PageWidget

if TYPE_CHECKING:
from redux_pytest.fixtures import WaitFor
Expand Down Expand Up @@ -87,6 +86,9 @@ def check() -> None:
assert not app_context.app.menu_widget._is_transition_in_progress # noqa: SLF001
current_page = app_context.app.menu_widget.current_screen
assert current_page is not None

from ubo_gui.page import PageWidget

assert isinstance(current_page, PageWidget)
assert all(item is None for item in current_page.items)
if placeholder is not None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@
"docker": {
"_id": "baf3897a3e70f16a55485822de1b372a",
"_type": "DockerState",
"envoy_grpc": {
"_type": "ImageState",
"container_ip": null,
"docker_id": null,
"id": "envoy_grpc",
"ports": [],
"status": "not_available"
},
"home_assistant": {
"_type": "ImageState",
"container_ip": null,
Expand Down Expand Up @@ -157,7 +165,24 @@
"items": [
{
"_type": "ActionItem",
"action": "<function:open_image_menu>",
"action": "<functools.partial:<function:composition_menu>>",
"background_color": "#68B7FF",
"color": [
1,
1,
1,
1
],
"icon": "󱂇",
"is_short": false,
"key": "docker:envoy_grpc",
"label": "Envoy for gRPC",
"opacity": null,
"progress": null
},
{
"_type": "ActionItem",
"action": "<functools.partial:<function:composition_menu>>",
"background_color": "#68B7FF",
"color": [
1,
Expand All @@ -174,7 +199,7 @@
},
{
"_type": "ActionItem",
"action": "<function:open_image_menu>",
"action": "<functools.partial:<function:composition_menu>>",
"background_color": "#68B7FF",
"color": [
1,
Expand All @@ -191,7 +216,19 @@
},
{
"_type": "ActionItem",
"action": "<function:open_image_menu>",
"action": "<functools.partial:<function:input_docker_composition>>",
"background_color": "#FFC107",
"color": "black",
"icon": "󰋺",
"is_short": false,
"key": "docker:_import",
"label": "Import YAML file",
"opacity": null,
"progress": null
},
{
"_type": "ActionItem",
"action": "<functools.partial:<function:composition_menu>>",
"background_color": "#68B7FF",
"color": [
1,
Expand All @@ -208,7 +245,7 @@
},
{
"_type": "ActionItem",
"action": "<function:open_image_menu>",
"action": "<functools.partial:<function:composition_menu>>",
"background_color": "#68B7FF",
"color": [
1,
Expand All @@ -225,7 +262,7 @@
},
{
"_type": "ActionItem",
"action": "<function:open_image_menu>",
"action": "<functools.partial:<function:composition_menu>>",
"background_color": "#68B7FF",
"color": [
1,
Expand All @@ -242,7 +279,7 @@
},
{
"_type": "ActionItem",
"action": "<function:open_image_menu>",
"action": "<functools.partial:<function:composition_menu>>",
"background_color": "#68B7FF",
"color": [
1,
Expand All @@ -259,7 +296,7 @@
},
{
"_type": "ActionItem",
"action": "<function:open_image_menu>",
"action": "<functools.partial:<function:composition_menu>>",
"background_color": "#68B7FF",
"color": [
1,
Expand Down Expand Up @@ -844,23 +881,6 @@
"sub_menu": {
"_type": "HeadlessMenu",
"items": [
{
"_type": "ActionItem",
"action": "<function:setup_menu_action>",
"background_color": "#68B7FF",
"color": [
1,
1,
1,
1
],
"icon": "",
"is_short": false,
"key": "docker:service",
"label": "Service",
"opacity": null,
"progress": null
},
{
"_type": "SubMenuItem",
"background_color": "#68B7FF",
Expand Down Expand Up @@ -902,6 +922,23 @@
"sub_heading": "Log in to a registry:",
"title": "󱥉Docker Registries"
}
},
{
"_type": "ActionItem",
"action": "<function:setup_menu_action>",
"background_color": "#68B7FF",
"color": [
1,
1,
1,
1
],
"icon": "",
"is_short": false,
"key": "docker:service",
"label": "Service",
"opacity": null,
"progress": null
}
],
"placeholder": "No settings in this category",
Expand Down Expand Up @@ -1050,7 +1087,7 @@
"IP Addresses": 0,
"Picovoice Settings": 0,
"RPi Connect": null,
"Registries": null,
"Registries": 2,
"SSH": 1,
"Service": 1,
"Users": 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@
"docker": {
"_id": "baf3897a3e70f16a55485822de1b372a",
"_type": "DockerState",
"envoy_grpc": {
"_type": "ImageState",
"container_ip": null,
"docker_id": null,
"id": "envoy_grpc",
"ports": [],
"status": "not_available"
},
"home_assistant": {
"_type": "ImageState",
"container_ip": null,
Expand Down Expand Up @@ -157,7 +165,24 @@
"items": [
{
"_type": "ActionItem",
"action": "<function:open_image_menu>",
"action": "<functools.partial:<function:composition_menu>>",
"background_color": "#68B7FF",
"color": [
1,
1,
1,
1
],
"icon": "󱂇",
"is_short": false,
"key": "docker:envoy_grpc",
"label": "Envoy for gRPC",
"opacity": null,
"progress": null
},
{
"_type": "ActionItem",
"action": "<functools.partial:<function:composition_menu>>",
"background_color": "#68B7FF",
"color": [
1,
Expand All @@ -174,7 +199,7 @@
},
{
"_type": "ActionItem",
"action": "<function:open_image_menu>",
"action": "<functools.partial:<function:composition_menu>>",
"background_color": "#68B7FF",
"color": [
1,
Expand All @@ -191,7 +216,19 @@
},
{
"_type": "ActionItem",
"action": "<function:open_image_menu>",
"action": "<functools.partial:<function:input_docker_composition>>",
"background_color": "#FFC107",
"color": "black",
"icon": "󰋺",
"is_short": false,
"key": "docker:_import",
"label": "Import YAML file",
"opacity": null,
"progress": null
},
{
"_type": "ActionItem",
"action": "<functools.partial:<function:composition_menu>>",
"background_color": "#68B7FF",
"color": [
1,
Expand All @@ -208,7 +245,7 @@
},
{
"_type": "ActionItem",
"action": "<function:open_image_menu>",
"action": "<functools.partial:<function:composition_menu>>",
"background_color": "#68B7FF",
"color": [
1,
Expand All @@ -225,7 +262,7 @@
},
{
"_type": "ActionItem",
"action": "<function:open_image_menu>",
"action": "<functools.partial:<function:composition_menu>>",
"background_color": "#68B7FF",
"color": [
1,
Expand All @@ -242,7 +279,7 @@
},
{
"_type": "ActionItem",
"action": "<function:open_image_menu>",
"action": "<functools.partial:<function:composition_menu>>",
"background_color": "#68B7FF",
"color": [
1,
Expand All @@ -259,7 +296,7 @@
},
{
"_type": "ActionItem",
"action": "<function:open_image_menu>",
"action": "<functools.partial:<function:composition_menu>>",
"background_color": "#68B7FF",
"color": [
1,
Expand Down Expand Up @@ -909,23 +946,6 @@
"sub_menu": {
"_type": "HeadlessMenu",
"items": [
{
"_type": "ActionItem",
"action": "<function:setup_menu_action>",
"background_color": "#68B7FF",
"color": [
1,
1,
1,
1
],
"icon": "",
"is_short": false,
"key": "docker:service",
"label": "Service",
"opacity": null,
"progress": null
},
{
"_type": "SubMenuItem",
"background_color": "#68B7FF",
Expand Down Expand Up @@ -967,6 +987,23 @@
"sub_heading": "Log in to a registry:",
"title": "󱥉Docker Registries"
}
},
{
"_type": "ActionItem",
"action": "<function:setup_menu_action>",
"background_color": "#68B7FF",
"color": [
1,
1,
1,
1
],
"icon": "",
"is_short": false,
"key": "docker:service",
"label": "Service",
"opacity": null,
"progress": null
}
],
"placeholder": "No settings in this category",
Expand Down Expand Up @@ -1115,7 +1152,7 @@
"IP Addresses": 0,
"Picovoice Settings": 0,
"RPi Connect": null,
"Registries": null,
"Registries": 2,
"SSH": 1,
"Service": 1,
"Users": 1,
Expand Down
1 change: 0 additions & 1 deletion ubo_app/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@

DEBUG_MODE_DOCKER = str_to_bool(os.environ.get('UBO_DEBUG_DOCKER', 'False')) == 1
DOCKER_CREDENTIALS_TEMPLATE = 'DOCKER_CREDENTIALS_{}'
DOCKER_PREFIX = os.environ.get('UBO_DOCKER_PREFIX', '')

CONFIG_PATH = platformdirs.user_config_path(appname='ubo', ensure_exists=True)
SECRETS_PATH = CONFIG_PATH / '.secrets.env'
Expand Down
Loading

0 comments on commit e336ade

Please sign in to comment.