From 18ceaf0de6ef7375c2a77f148b87f2180092f39b Mon Sep 17 00:00:00 2001
From: schneider <schneider@blinkenlichts.net>
Date: Fri, 1 Dec 2023 22:32:09 +0100
Subject: [PATCH] load assets from bundle path

---
 __init__.py | 16 +---------------
 flow3r.toml |  2 +-
 2 files changed, 2 insertions(+), 16 deletions(-)

diff --git a/__init__.py b/__init__.py
index e1ceae7..2cbf887 100644
--- a/__init__.py
+++ b/__init__.py
@@ -9,21 +9,7 @@ import sys
 class MOiN(Application):
     def __init__(self, app_ctx: ApplicationContext) -> None:
         super().__init__(app_ctx)
-        self.image_path = ""
-
-        paths = [path for path in sys.path if path.startswith("/")]
-        app_names = ["MOiN", "technotroll-MOiN"]
-
-        for path in paths:
-            for app_name in app_names:
-                self.image_path = path + "/apps/" + app_name + "/moin.png"
-
-                # Try to load image from known paths and use first result
-                try:
-                    os.stat(self.image_path)
-                    break
-                except OSError:
-                    pass
+        self.image_path = f"{self.app_ctx.bundle_path}/moin.png"
 
     def draw(self, ctx: Context) -> None:
         # Paint the background black
diff --git a/flow3r.toml b/flow3r.toml
index e2088b3..a4f703b 100644
--- a/flow3r.toml
+++ b/flow3r.toml
@@ -26,4 +26,4 @@ description = "This app shows the MOiN logo on the CCCamp23 flow3r badge screen
 # increased, we interpret this as a new version being released.
 #
 # Version number must be an integer!
-version = 1
+version = 2
-- 
GitLab