From 32e8070729f22610938c1b47fcbf31ed83922773 Mon Sep 17 00:00:00 2001 From: gschennersie <> Date: Fri, 30 Jun 2023 13:59:57 +0200 Subject: [PATCH] chore: use empty.png from resources folder --- .../ooasp/resources/__init__.py | 0 .../{out => ooasp/resources}/empty.png | Bin asp_interactive_configuration/ooasp/ui.py | 5 ++++- 3 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 asp_interactive_configuration/ooasp/resources/__init__.py rename asp_interactive_configuration/{out => ooasp/resources}/empty.png (100%) diff --git a/asp_interactive_configuration/ooasp/resources/__init__.py b/asp_interactive_configuration/ooasp/resources/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/asp_interactive_configuration/out/empty.png b/asp_interactive_configuration/ooasp/resources/empty.png similarity index 100% rename from asp_interactive_configuration/out/empty.png rename to asp_interactive_configuration/ooasp/resources/empty.png diff --git a/asp_interactive_configuration/ooasp/ui.py b/asp_interactive_configuration/ooasp/ui.py index f1195ee7..5d51d161 100644 --- a/asp_interactive_configuration/ooasp/ui.py +++ b/asp_interactive_configuration/ooasp/ui.py @@ -1,9 +1,11 @@ # Copyright (c) 2022 Siemens AG Oesterreich # SPDX-License-Identifier: MIT +from importlib import resources import ipywidgets as widgets from ipywidgets import Button, VBox, Label, Layout,GridspecLayout, HTML from IPython.display import display, Image +import ooasp.resources def basic_layout(): return VBox(layout=Layout(height='auto', width='auto')) @@ -119,7 +121,8 @@ def set_found_config(self): Sets the found configuration image """ if self.iconf.found_config is None: - image = Image(f"out/empty.png") + path = resources.files(ooasp.resources).joinpath("empty.png") + image = Image(str(path)) self.found_config.value = image.data else: self.iconf.found_config.save_png("out/found/")