python类app()的实例源码

tests.py 文件源码 项目:AppServer 作者: skytoup 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def get_app_versions(app_id, page):
    _, response = app.test_client.get('/apps/{}/versions/page/{}?t={}'.format(app_id, page, time.time()))
    response_normal_check(response)
    return response
tests.py 文件源码 项目:AppServer 作者: skytoup 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def put_app_detail(app_id, name, short_chain, detail):
    _, response = app.test_client.put('/apps/{}'.format(app_id),
                                      data=ujson.dumps(dict(name=name, short_chain=short_chain, detail=detail)))
    response_normal_check(response)
    return response
tests.py 文件源码 项目:AppServer 作者: skytoup 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def del_app_version(app_id, package_id):
    _, response = app.test_client.delete('/apps/{}/versions/{}'.format(app_id, package_id))
    response_normal_check(response)
    return response
manage.py 文件源码 项目:wait-less 作者: BusinessAgile 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def make_shell_context():
    return dict(app=app)
test_convert.py 文件源码 项目:schemaker 作者: mozilla 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def client():
    return testing.TestClient(app.app)
main.py 文件源码 项目:Mk3-Firmware 作者: emfcamp 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def main_menu():
    while True:
        clear()

        menu_items = [
            {"title": "Browse app library", "function": store},
            {"title": "Update apps and libs", "function": update},
            {"title": "Remove app", "function": remove}
        ]

        option = dialogs.prompt_option(menu_items, none_text="Exit", text="What do you want to do?", title="TiLDA App Library")

        if option:
            option["function"]()
        else:
            return
main.py 文件源码 项目:Mk3-Firmware 作者: emfcamp 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def update():
    clear()
    connect()

    with dialogs.WaitingMessage(text="Downloading full list of library files", title="TiLDA App Library") as message:
        message.text="Downloading full list of library files"
        master = http_client.get("http://api.badge.emfcamp.org/firmware/master-lib.json").raise_for_status().json()
        libs_to_update = []
        for lib, expected_hash in master.items():
            if expected_hash != filesystem.calculate_hash("lib/" + lib):
                libs_to_update.append({
                    "url": "http://api.badge.emfcamp.org/firmware/master/lib/" + lib,
                    "target": "lib/" + lib,
                    "expected_hash": expected_hash,
                    "title": lib
                })
        download_list(libs_to_update, message)

        apps = get_local_apps()
        for i, app in enumerate(apps):
            message.text = "Updating app %s" % app
            if app.fetch_api_information():
                download_app(app, message)

    dialogs.notice("Everything is up-to-date")
main.py 文件源码 项目:Mk3-Firmware 作者: emfcamp 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def store():
    global apps_by_category

    while True:
        empty_local_app_cache()
        clear()
        connect()

        with dialogs.WaitingMessage(text="Fetching app library...", title="TiLDA App Library"):
            categories = get_public_app_categories()

        category = dialogs.prompt_option(categories, text="Please select a category", select_text="Browse", none_text="Back")
        if category:
            store_category(category)
        else:
            return
device.py 文件源码 项目:needle 作者: mwrlabs 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def __init__(self, ip, port, agent_port, username, password, pub_key_auth, tools):
        # Setup params
        self._ip = ip
        self._port = port
        self._agent_port = agent_port
        self._username = username
        self._password = password
        self._pub_key_auth = bool(pub_key_auth)
        self._tools_local = tools
        # Init related objects
        self.app = App(self)
        self.local_op = LocalOperations()
        self.remote_op = RemoteOperations(self)
        self.printer = Printer()
        self.agent = NeedleAgent(self)

    # ==================================================================================================================
    # UTILS - USB
    # ==================================================================================================================
main.py 文件源码 项目:Mk3-Firmware 作者: emfcamp 项目源码 文件源码 阅读 39 收藏 0 点赞 0 评论 0
def connect():
    wifi.connect(
        wait=True,
        show_wait_message=True,
        prompt_on_fail=True,
        dialog_title='TiLDA App Library'
    )

### VIEWS ###
main.py 文件源码 项目:Mk3-Firmware 作者: emfcamp 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def store_details(category, app):
    clear()
    empty_local_app_cache()
    with dialogs.WaitingMessage(text="Fetching app information...", title="TiLDA App Library"):
        app.fetch_api_information()

    clear()
    if dialogs.prompt_boolean(app.description, title = str(app), true_text = "Install", false_text="Back"):
        install(app)
        dialogs.notice("%s has been successfully installed" % app)
main.py 文件源码 项目:Mk3-Firmware 作者: emfcamp 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def remove():
    clear()

    app = dialogs.prompt_option(get_local_apps(), title="TiLDA App Library", text="Please select an app to remove", select_text="Remove", none_text="Back")

    if app:
        clear()
        with dialogs.WaitingMessage(text="Removing %s\nPlease wait..." % app, title="TiLDA App Library"):
            for file in os.listdir(app.folder_path):
                os.remove(app.folder_path + "/" + file)
            os.remove(app.folder_path)
        remove()
nails.py 文件源码 项目:nails 作者: jamrizzi 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def __init__(self, app):
        self.app = App(app)
main_qt.py 文件源码 项目:Small-2D-App 作者: cprogrammer1994 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def initializeGL(self):
        self.app = App()


问题


面经


文章

微信
公众号

扫码关注公众号