当前位置: 首页>>代码示例>>Python>>正文


Python Client.get_ios方法代码示例

本文整理汇总了Python中models.Client.get_ios方法的典型用法代码示例。如果您正苦于以下问题:Python Client.get_ios方法的具体用法?Python Client.get_ios怎么用?Python Client.get_ios使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在models.Client的用法示例。


在下文中一共展示了Client.get_ios方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: app_edit_post

# 需要导入模块: from models import Client [as 别名]
# 或者: from models.Client import get_ios [as 别名]
def app_edit_post(appid):
    """
    修改应用
    """
    db = g._db
    android, ios = _get_clients()

    developer_id = 0
    if android:
        push_types = request.form.getlist('push_type')
        xinge_access_id = request.form.get('xinge_access_id', '')
        xinge_secret_key = request.form.get('xinge_secret_key', '')
        mi_appid = request.form.get('mi_appid', '')
        mi_secret_key = request.form.get('mi_secret_key', '')
        hw_appid = request.form.get('hw_appid', '')
        hw_secret_key = request.form.get('hw_secret_key', '')
        gcm_sender_id = request.form.get('gcm_sender_id', '')
        gcm_api_key = request.form.get('gcm_api_key', '')
        
        c = Client.get_android(db, appid)
        if not c:
            client_id = Client.gen_id(db)
            Client.create_client(db, client_id, appid, developer_id, PlatformType.ANDROID, android['platform_identity'])
            Client.create_android(db, client_id, xinge_access_id, xinge_secret_key, mi_appid, mi_secret_key, hw_appid, hw_secret_key, gcm_sender_id, gcm_api_key)
        else:
            Client.update_android(db, c['id'], xinge_access_id, xinge_secret_key, mi_appid, mi_secret_key, hw_appid, hw_secret_key, gcm_sender_id, gcm_api_key)
 
    if ios:
        sandbox_key_file = request.files.get('sandbox_key')
        if sandbox_key_file:
            filename = sandbox_key_file.filename
            ext = os.path.splitext(filename)[1]
            if ext == '.p12':
                sandbox_key = sandbox_key_file.read()
                sandbox_key_secret = request.form.get('sandbox_key_secret')
            else:
                sandbox_key = ""
                sandbox_key_secret = ""
        else:
            sandbox_key = ""
            sandbox_key_secret = ""

        production_key_file = request.files.get('production_key')
        if production_key_file:
            filename = production_key_file.filename
            ext = os.path.splitext(filename)[1]
            if ext == '.p12':
                production_key = production_key_file.read()
                production_key_secret = request.form.get('production_key_secret')
            else:
                production_key = ""
                production_key_secret = ""

        else:
            production_key = ""
            production_key_secret = ""

        c = Client.get_ios(db, appid)
        if not c:
            client_id = Client.gen_id(db)
            Client.create_client(db, client_id, appid, developer_id, PlatformType.IOS, ios['platform_identity'])
            Client.create_ios(db, client_id, sandbox_key, sandbox_key_secret, production_key, production_key_secret)
        else:
            Client.update_ios(db, c['id'], sandbox_key, sandbox_key_secret, production_key, production_key_secret)


    return redirect(url_for('.app_detail', appid=appid))
开发者ID:richmonkey,项目名称:xiaowei_web,代码行数:69,代码来源:application.py


注:本文中的models.Client.get_ios方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。