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


Python leancloud.init方法代码示例

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


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

示例1: init

# 需要导入模块: import leancloud [as 别名]
# 或者: from leancloud import init [as 别名]
def init(cls, client, convid=None, name=None, m=None, c=None, mu=None):
        '''
        :param client:  realtime client
        :param convid: conversation id
        :param name:    conversation name
        :param m:       conversation members
        :param c:       conversation creator clientid
        :param mu:      ??????????????? iOS ?? Windows Phone ?????
        '''
        instance = cls(client=client, convid=convid)
        if convid:
            conversation = instance._get_conversation_by_id(convid)
            if not conversation:
                raise RealtimeAPIError('404', 'Conversation not found')
            return cls(client=client, convid=convid)
        else:
            params = {
                "name": name,
                "m": m,
                "mu": mu,
            }
            conversation = self.client.create_conversation(json_body=params)
            return cls(client=client, convid=conversation.get('objectId')) 
开发者ID:gusibi,项目名称:py-realtime-sdk,代码行数:25,代码来源:client.py

示例2: setup_leancloud

# 需要导入模块: import leancloud [as 别名]
# 或者: from leancloud import init [as 别名]
def setup_leancloud():
    import leancloud

    leancloud.init(
        os.environ['LEANCLOUD_APP_ID'],
        app_key=os.environ['LEANCLOUD_APP_KEY'],
        master_key=os.environ['LEANCLOUD_APP_MASTER_KEY']
    )
    leancloud.use_master_key(False)

    return leancloud.Engine(app.setup()) 
开发者ID:bearyinnovative,项目名称:bcjoy.py,代码行数:13,代码来源:wsgi.py

示例3: _get_conversation_by_id

# 需要导入模块: import leancloud [as 别名]
# 或者: from leancloud import init [as 别名]
def _get_conversation_by_id(self, id):
        leancloud.init(self.client.app_id, self.client.app_key)
        _Conversation = leancloud.Object.extend('_Conversation')
        # query = leancloud.Query('_Conversation')
        # ????? Todo ? query ??
        query = _Conversation.query

        # ????????? objectId
        try:
            conversation = query.get(id)
        except LeanCloudError as e:
            raise RealtimeAPIError(e.code, e.error)
        return conversation 
开发者ID:gusibi,项目名称:py-realtime-sdk,代码行数:15,代码来源:client.py

示例4: leancloud_init

# 需要导入模块: import leancloud [as 别名]
# 或者: from leancloud import init [as 别名]
def leancloud_init():
    leancloud.init(constant.leancloud.APP_ID, constant.leancloud.APP_KEY) 
开发者ID:fangbicheng,项目名称:crawlnews_Python,代码行数:4,代码来源:upload_leancloud.py

示例5: __init__

# 需要导入模块: import leancloud [as 别名]
# 或者: from leancloud import init [as 别名]
def __init__(self, app_id, app_key):
        self.app_id = app_id
        self.app_key = app_key
        leancloud.init(app_id, app_key) 
开发者ID:yubang,项目名称:ilog,代码行数:6,代码来源:lc.py


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