def install_app(i,fromcat): system.serialWarning() global category slug = category[i]["slug"] category = None showMessage("Installing "+slug+"...") uinstaller.install(slug)
def install_app(i, fromcat): system.serialWarning() global category slug = category[i]["slug"] category = None gc.collect() if not wifi.status(): wifi.connect() wifi.wait() if not wifi.status(): showMessage("Unable to connect to WiFi.") time.sleep(2) show_category(fromcat) showMessage("Installing " + slug + "...") uinstaller.install(slug)
wifi.disconnect() gc.collect() uinterface.connect_wifi() retry -= 1 if retry == 0: print("This is not ok, rebooting") system.reboot() categories = woezel.get_categories() active_categories = [cat for cat in categories if cat['eggs'] > 0] if len(active_categories) == 0: rgb.clear() rgb.framerate(20) uinterface.skippabletext('Error loading') system.start("appstore") while True: chosen_index = uinterface.menu([app['name'] for app in active_categories]) if chosen_index is None: system.reboot() category = active_categories[chosen_index] apps = woezel.get_category(category['slug']) chosen_index = uinterface.menu([app['name'] for app in apps]) if chosen_index is None: continue app = apps[chosen_index] uinstaller.install(app['slug'])
buttons.register(defines.BTN_LEFT, input_left) buttons.register(defines.BTN_RIGHT, input_right) populate_apps() render_current_app() start() init_power_management() # Install CZ countdown app to replace activities app if not machine.nvs_getint('system', 'czcount_inst'): if woezel.is_installed('campzone_2020_countdown'): machine.nvs_setint('system', 'czcount_inst', 1) else: if uinterface.connect_wifi(): uinstaller.install('campzone_2020_countdown') render_current_app() cfg_term_menu = machine.nvs_get_u8('splash', 'term_menu') if cfg_term_menu == None: cfg_term_menu = True if cfg_term_menu: menu = term_menu.UartMenu(deepsleep.start_sleeping, pm) menu.main() else: print("Welcome!") print("Press CTRL+C to reboot directly to a Python prompt.") wait = True while wait: