| Total Complexity | 11 |
| Total Lines | 44 |
| 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 | def _update_url_token(self, url_token): |
||
| 27 | return self._client.update_url_token(url_token) |
||
| 28 | |||
| 29 | @property |
||
| 30 | def school_code(self): |
||
| 31 | return self._client.school.code |
||
| 32 | |||
| 33 | @property |
||
| 34 | def user(self): |
||
| 35 | return self._client.user |
||
| 36 | |||
| 37 | @property |
||
| 38 | def school_url(self): |
||
| 39 | return self._client.school.url_path_list[self.user.user_type] |
||
| 40 | |||
| 41 | @property |
||
| 42 | def time_list(self): |
||
| 43 | return self._client.school.time_list |
||
| 44 |