Test Failed
Push — master ( d7daec...6c6a1b )
by dai
01:55
created

school.School.score()   A

Complexity

Conditions 1

Size

Total Lines 2
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 2
rs 10
c 0
b 0
f 0
cc 1
nop 3
1
#!/usr/bin/env python
2
# -*- coding: utf-8 -*-
3
from __future__ import absolute_import, unicode_literals
4
5
from redis import Redis
6
from school_api import SchoolClient
7
from school_api.session.redisstorage import RedisStorage
8
9
redis = Redis()
10
session = RedisStorage(redis)
11
12
13
class School():
14
    conf = {
15
        'session': session
16
    }
17
    GdstApi = SchoolClient('http://61.142.33.204', **conf)
18
19
    def __init__(self, user, password):
20
        self.student = self.GdstApi.user_login(user, password)
21
22
    def info(self):
23
        return self.student.get_info()
24
25
    def schedule(self, schedule_year=None, schedule_term=None):
26
        return self.student.get_schedule(schedule_year, schedule_term, schedule_type=1)
27
28
    def score(self, score_year=None, score_term=None):
29
        return self.student.get_score(score_year, score_term)
30