當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。