Skip to content
Snippets Groups Projects
Commit 99b7711b authored by technotroll's avatar technotroll
Browse files

Merge branch 'schneider/fix' into 'main'

load assets from bundle path

See merge request !1
parents 0b458aea 18ceaf0d
No related branches found
No related tags found
1 merge request!1load assets from bundle path
......@@ -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
......
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment