当前位置: 首页>>代码示例>>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;未经允许,请勿转载。