Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit b00f69c

Browse files
fix defaulting to current term / period
1 parent ae762d9 commit b00f69c

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

‎studentvue/StudentVue.py‎

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,19 @@ def get_attendance(self) -> OrderedDict:
8585
"""
8686
return self._xml_json_serialize(self._make_service_request('Attendance'))
8787

88-
def get_gradebook(self, report_period: int = 0) -> OrderedDict:
88+
def get_gradebook(self, report_period: int = None) -> OrderedDict:
8989
"""
9090
:param report_period: (optional) report period to fetch gradebook for
9191
:type report_period: int
9292
:return: student's gradebook for the specified report period
9393
:rtype: OrderedDict
9494
"""
95-
return self._xml_json_serialize(self._make_service_request('Gradebook', ReportPeriod=report_period))
95+
params = {}
96+
97+
if report_period is not None:
98+
params['ReportPeriod'] = report_period
99+
100+
return self._xml_json_serialize(self._make_service_request('Gradebook', **params))
96101

97102
def get_class_notes(self) -> OrderedDict:
98103
"""
@@ -108,14 +113,19 @@ def get_student_info(self) -> OrderedDict:
108113
"""
109114
return self._xml_json_serialize(self._make_service_request('StudentInfo'))
110115

111-
def get_schedule(self, term_index: int = 0) -> OrderedDict:
116+
def get_schedule(self, term_index: int = None) -> OrderedDict:
112117
"""
113118
:param term_index: (optional) term index to fetch schedule for
114119
:type term_index: int
115120
:return: student's schedule for the specified term
116121
:rtype: OrderedDict
117122
"""
118-
return self._xml_json_serialize(self._make_service_request('StudentClassList', TermIndex=term_index))
123+
params = {}
124+
125+
if term_index is not None:
126+
params['TermIndex'] = term_index
127+
128+
return self._xml_json_serialize(self._make_service_request('StudentClassList', **params))
119129

120130
def get_school_info(self) -> OrderedDict:
121131
"""

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /