Added support for externally sourced apps

This commit is contained in:
Andreas Völker
2019-01-01 12:36:45 +01:00
parent cc732a519d
commit 50f8dd29f7
3 changed files with 15 additions and 8 deletions

View File

@@ -29,12 +29,6 @@ Apps = [
{"guiname": "Show Framebuffer", "name": "fbcp", "cmd": ["apps/fbcp", "/dev/fb0"]},
{"guiname": "Strobo", "name": "strobo", "cmd": "apps/strobo.py"},
{"guiname": "Beispiel", "name": "example", "cmd": "apps/example.py"},
# mathpixel
{"guiname": "Structure formation", "name": "swifthohenberg", "cmd": "apps/swifthohenberg.py", "persistent": False},
{"guiname": "Quadratisch", "name": "quadratic", "cmd": "apps/quadratic.py"},
{"guiname": "Pendel", "name": "pendulum", "cmd": "apps/pendlum.py"},
{"guiname": "Konvergenz", "name": "convergence", "cmd": "apps/convergence.py"},
# juergen/pixelfoo
{"guiname": "Colored noise", "name": "cnoise", "cmd": "apps/cnoise", "persistent": False},
@@ -55,3 +49,16 @@ Apps = [
#{"name": "gif", "cmd": "apps/gif.sh"},
#{"name": "colormap", "cmd": "apps/colormap.py"},
]
# load additional apps from config/
import os
import os.path
configs = os.listdir("configs/")
import importlib
for config in configs:
file, ext = os.path.splitext(os.path.basename(config))
if ext != ".py" or file[0] == "_":
continue
modname = "configs."+file
lib = importlib.import_module(modname)
Apps += lib.Apps