(self, appid, access_token=None, session=None, timeout=None, auto_retry=True)
| 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): |
nothing calls this directly
no test coverage detected