コード例 #1
0
def show_remove():
    clear()
    app_to_remove = prompt_option(_get_current_apps(), none_text="Back", text="Select App to remove")
    if app_to_remove:
        ospath.recursive_rmdir(app_to_remove)
        app.uncache_apps()
        notice("%s has been removed" % app_to_remove, title=title, close_text="Back")
コード例 #2
0
ファイル: main.py プロジェクト: tswsl1989/Mk4-Apps
def show_remove():
    clear()
    app_to_remove = prompt_option(_get_current_apps(),
                                  title="Remove App...",
                                  none_text="Back",
                                  text="Select an App to remove.")
    if app_to_remove:
        ospath.recursive_rmdir(app_to_remove)
        app.uncache_apps()

        app_text = """App:\n{}""".format(app_to_remove)
        notice("\"%s\"\n\nThe app has now been removed." % app_text,
               title="Remove Success!",
               close_text="Back")
コード例 #3
0
def show_app(a):
    clear()
    with WaitingMessage():
        app_info = store.get_app(a)

    install = prompt_boolean(app_info["description"], title=a, true_text="Install", false_text="Back")

    if install:
        with WaitingMessage(title="Installing %s" % a, text="Please wait...") as message:
            installers = store.install(_get_current_apps() + [a])
            n = len(installers)
            for i, installer in enumerate(installers):
                message.text = "%s (%s/%s)" % (installer.path, i + 1, n)
                installer.download()
            app.uncache_apps()

        notice("App %s has been successfully installed" % a, title=title, close_text="Back")
コード例 #4
0
ファイル: main.py プロジェクト: tswsl1989/Mk4-Apps
def show_app(a, c):
    clear()
    with WaitingMessage(title=title, text="Loading app description..."):
        app_info = store.get_app(a)

    # Try to get the 'title' key from app_info, falling back to the value of a if not present
    name = app_info.get("title", a)
    desc = app_info["description"].strip()
    app_text = """App:\n{}\n\nDescription:\n{}""".format(name, desc)
    install = prompt_boolean(app_text,
                             title="Install App",
                             true_text="Install",
                             false_text="Back")

    if install:
        app_text = "App:\n{}\n\n".format(name)
        with WaitingMessage(title="Installing App...",
                            text="%sGetting ready..." % app_text) as message:
            installers = store.install([a])
            n = len(installers)
            for i, installer in enumerate(installers):
                message.text = "%s%s (%s/%s)" % (app_text +
                                                 "Downloading files...\n\n",
                                                 installer.path, i + 1, n)
                installer.download()
            app.uncache_apps()

        launch = prompt_boolean(
            "%sSuccessfully installed.\n\nPress A to launch the app.\n\nPress B to list more \"%s\" apps."
            % (app_text, c),
            title="Install Success!",
            true_text="Launch",
            false_text="Back")
        if (launch):
            for app_obj in get_apps():
                if app_obj.name == a:
                    app_obj.boot()
        else:
            show_apps(c)
    else:
        show_apps(c)