當前位置: 首頁>>代碼示例>>Python>>正文


Python StorageTools.getIdentity方法代碼示例

本文整理匯總了Python中yowsup.common.tools.StorageTools.getIdentity方法的典型用法代碼示例。如果您正苦於以下問題:Python StorageTools.getIdentity方法的具體用法?Python StorageTools.getIdentity怎麽用?Python StorageTools.getIdentity使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在yowsup.common.tools.StorageTools的用法示例。


在下文中一共展示了StorageTools.getIdentity方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from yowsup.common.tools import StorageTools [as 別名]
# 或者: from yowsup.common.tools.StorageTools import getIdentity [as 別名]
    def __init__(self,cc, p_in, code):
        super(WARegRequest,self).__init__()
        idx = StorageTools.getIdentity(cc + p_in)

        if idx is None:
            raise ValueError("You have to request code first")

        self.addParam("cc", cc)
        self.addParam("in", p_in)

        self.addParam("id", idx)
        self.addParam("code", code)

        self.url = "v.whatsapp.net/v2/register"

        self.pvars = ["status", "login", "pw", "type", "expiration", "kind", "price", "cost", "currency", "price_expiration",
                      "reason","retry_after"]

        self.setParser(JSONResponseParser())
開發者ID:3esmit,項目名稱:yowsup,代碼行數:21,代碼來源:regrequest.py

示例2: __init__

# 需要導入模塊: from yowsup.common.tools import StorageTools [as 別名]
# 或者: from yowsup.common.tools.StorageTools import getIdentity [as 別名]
    def __init__(self,cc, p_in, mcc= "000", mnc = "000", sim_mcc = "000", sim_mnc = "000", method="sms"):
        super(WACodeRequest,self).__init__()
        idx = StorageTools.getIdentity(cc + p_in)

        self.p_in = p_in
        self.__id = idx
        self.cc = cc

        self.addParam("cc", cc)
        self.addParam("in", p_in)
        self.addParam("lc", "GB")
        self.addParam("lg", "en")
        self.addParam("sim_mcc", sim_mcc.zfill(3))
        self.addParam("sim_mnc", sim_mnc.zfill(3))
        self.addParam("mcc", sim_mcc.zfill(3))
        self.addParam("mnc", sim_mnc.zfill(3))
        self.addParam("method", method)

        self.addParam("mistyped", "6")
        self.addParam("network_radio_type", "1")
        self.addParam("simnum", "1")
        self.addParam("s", "")
        self.addParam("copiedrc", "1")
        self.addParam("hasinrc", "1")
        self.addParam("rcmatch", "1")
        self.addParam("pid", os.getpid())
        self.addParam("rchash", hashlib.sha256(os.urandom(20)).hexdigest())
        self.addParam("anhash", hashlib.md5(os.urandom(20)).hexdigest())
        self.addParam("extexist", "1")
        self.addParam("extstate", "1")

        self.addParam("token", CURRENT_ENV.getToken(p_in))

        self.url = "v.whatsapp.net/v2/code"

        self.pvars = ["status","reason","length", "method", "retry_after", "code", "param"] +\
                    ["login", "pw", "type", "expiration", "kind", "price", "cost", "currency", "price_expiration"]

        self.setParser(JSONResponseParser())
開發者ID:MauricioAHM,項目名稱:yowsup,代碼行數:41,代碼來源:coderequest.py

示例3: __init__

# 需要導入模塊: from yowsup.common.tools import StorageTools [as 別名]
# 或者: from yowsup.common.tools.StorageTools import getIdentity [as 別名]
    def __init__(self,cc, p_in, mcc= "000", mnc = "000", sim_mcc = "000", sim_mnc = "000", method="sms"):
        super(WACodeRequest,self).__init__()
        idx = StorageTools.getIdentity(cc + p_in)

        self.p_in = p_in
        self.__id = idx
        self.cc = cc

        self.addParam("cc", cc)
        self.addParam("in", p_in)
        self.addParam("lc", "GB")
        self.addParam("lg", "en")
        self.addParam("sim_mcc", sim_mcc.zfill(3))
        self.addParam("sim_mnc", sim_mnc.zfill(3))
        self.addParam("method", method)

        self.addParam("token", CURRENT_ENV.getToken(p_in))

        self.url = "v.whatsapp.net/v2/code"

        self.pvars = ["status","reason","length", "method", "retry_after", "code", "param"] +\
                    ["login", "pw", "type", "expiration", "kind", "price", "cost", "currency", "price_expiration"]

        self.setParser(JSONResponseParser())
開發者ID:3esmit,項目名稱:yowsup,代碼行數:26,代碼來源:coderequest.py


注:本文中的yowsup.common.tools.StorageTools.getIdentity方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。