Skip to content

Commit

Permalink
Work towards installing apps from hatchery
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewWilkes committed May 21, 2022
1 parent 96bf5f8 commit 1e67c9f
Showing 5 changed files with 14 additions and 9 deletions.
10 changes: 5 additions & 5 deletions modules/app_launcher/__init__.py
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@
import sys
import ujson
import os
import functools

SPLASHSCREEN_TIME = 300 # ms

@@ -26,7 +27,6 @@ def loadInfo(self, folder, name):
information = f.read()
return ujson.loads(information)
except BaseException as e:
sys.print_exception(e)
return {}

def list_user_apps(self):
@@ -79,10 +79,10 @@ def list_core_apps(self):
def choices(self):
# Note, the text for each choice needs to be <= 16 characters in order to fit on screen
apps = self.list_core_apps() + self.list_user_apps()
return [
tuple([app['name'], lambda: self.launch(app['path'], app['callable'])])
for app in apps
]
choices = []
for app in apps:
choices.append((app['name'], functools.partial(self.launch, app['path'], app['callable'])))
return choices

# Boot entry point
def main(self):
6 changes: 5 additions & 1 deletion modules/consts.py
Original file line number Diff line number Diff line change
@@ -3,4 +3,8 @@
INFO_HARDWARE_NAME = "TiDAL"
INFO_HARDWARE_WOEZEL_NAME = "tidal"
INFO_FIRMWARE_BUILD = ota.get_version()
DEFAULT_ORIENTATION = 0
DEFAULT_ORIENTATION = 0

# Change this to the EMFCamp instance
WOEZEL_WEB_SERVER = "hatchery.badge.team"
INFO_HARDWARE_WOEZEL_NAME = "pixel"
4 changes: 2 additions & 2 deletions modules/dashboard/terminal/installer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import dashboard.resources.woezel_repo as woezel_repo, woezel, term, system, time, wifi, sys, gc
import dashboard.resources.woezel_repo as woezel_repo, woezel, term, system, time, wifi, sys, gc, term_menu

repo = woezel_repo

@@ -15,7 +15,7 @@ def show_categories():
opt.append("< Back to launcher")
sel = term.menu("Installer - Categories", opt)
if sel == len(repo.categories):
system.launcher(True)
term_menu.return_to_home()
opt = []
gc.collect()
show_category(repo.categories[sel]["slug"], repo.categories[sel]["name"])
2 changes: 1 addition & 1 deletion modules/dashboard/terminal/launcher.py
Original file line number Diff line number Diff line change
@@ -70,7 +70,7 @@ def get_install_path():
global install_path
if install_path is None:
# sys.path[0] is current module's path
install_path = sys.path[1]
install_path = "/"
install_path = expandhome(install_path)
return install_path

1 change: 1 addition & 0 deletions tildamk6/manifest.py
Original file line number Diff line number Diff line change
@@ -45,6 +45,7 @@ def freeze_images(path, generated_dir):
freeze("$(MPY_DIR)/../modules")
freeze("$(MPY_DIR)/../micropython-lib/python-ecosys/urequests", "urequests.py")
freeze("$(MPY_DIR)/../micropython-lib/micropython/upysh", "upysh.py")
freeze("$(MPY_DIR)/../micropython-lib/python-stdlib/functools", "functools.py")
freeze_images("$(MPY_DIR)/../modules", "$(PORT_DIR)/build-tildamk6/modules_generated")

freeze("$(MPY_DIR)/../st7789/fonts/bitmap", "vga2_8x8.py")

0 comments on commit 1e67c9f

Please sign in to comment.