本文整理汇总了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())
示例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())
示例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())