Passed
Push — master ( b6dc32...e9e603 )
by dai
01:46
created

BaseSchoolApi.school_code()   A

Complexity

Conditions 1

Size

Total Lines 3
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 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