Total Complexity | 14 |
Total Lines | 57 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | # -*- coding: utf-8 -*- |
||
2 | from __future__ import absolute_import, unicode_literals |
||
3 | |||
4 | |||
5 | class BaseSchoolApi(object): |
||
6 | """ WeChat API base class """ |
||
7 | |||
8 | def __init__(self, client=None): |
||
9 | self._client = client |
||
10 | |||
11 | def _get(self, url, **kwargs): |
||
12 | return self._client.get(url, **kwargs) |
||
13 | |||
14 | def _post(self, url, **kwargs): |
||
15 | return self._client.post(url, **kwargs) |
||
16 | |||
17 | def _head(self, url, **kwargs): |
||
18 | return self._client.head(url, **kwargs) |
||
19 | |||
20 | def _get_view_state(self, url, **kwargs): |
||
21 | return self._client.get_view_state(url, **kwargs) |
||
22 | |||
23 | def _switch_proxy(self): |
||
24 | return self._client.switch_proxy() |
||
25 | |||
26 | @property |
||
27 | def code(self): |
||
28 | return self._client.school.code |
||
29 | |||
30 | @property |
||
31 | def account(self): |
||
32 | return self._client.account |
||
33 | |||
34 | @property |
||
35 | def password(self): |
||
36 | return self._client.password |
||
37 | |||
38 | @property |
||
39 | def session(self): |
||
40 | return self._client.session |
||
41 | |||
42 | @property |
||
43 | def user_type(self): |
||
44 | return self._client.user_type |
||
45 | |||
46 | @property |
||
47 | def base_url(self): |
||
48 | return self._client.base_url |
||
49 | |||
50 | @property |
||
51 | def school_url(self): |
||
52 | return self._client.school.url_endpoint[self.user_type] |
||
53 | |||
54 | @property |
||
55 | def time_list(self): |
||
56 | return self._client.school.time_list |
||
57 |