MCPcopy
hub / github.com/wechatpy/wechatpy / __init__

Method __init__

wechatpy/client/base.py:37–57  ·  view source on GitHub ↗
(self, appid, access_token=None, session=None, timeout=None, auto_retry=True)

Source from the content-addressed store, hash-verified

35 return self
36
37 def __init__(self, appid, access_token=None, session=None, timeout=None, auto_retry=True):
38 self._http = requests.Session()
39 self.appid = appid
40 self.expires_at = None
41 self.session = session or MemoryStorage()
42 self.timeout = timeout
43 self.auto_retry = auto_retry
44
45 if isinstance(session, six.string_types):
46 from shove import Shove
47 from wechatpy.session.shovestorage import ShoveStorage
48
49 querystring = get_querystring(session)
50 prefix = querystring.get('prefix', ['wechatpy'])[0]
51
52 shove = Shove(session)
53 storage = ShoveStorage(shove, prefix)
54 self.session = storage
55
56 if access_token:
57 self.session.set(self.access_token_key, access_token)
58
59 @property
60 def access_token_key(self):

Callers

nothing calls this directly

Calls 5

MemoryStorageClass · 0.90
get_querystringFunction · 0.90
ShoveStorageClass · 0.90
getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected