FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

update documentation · robquant/python-webuntis@55ce894 · GitHub

Commit 55ce894

Browse files
committed
update documentation
1 parent 901867f commit 55ce894

3 files changed

Lines changed: 34 additions & 13 deletions

File tree

‎docs/session.rst‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,9 @@ Things you can do with the API
2929
.. automethod:: statusdata
3030
.. automethod:: subjects
3131
.. automethod:: teachers
32+
.. automethod:: statusdata
33+
.. automethod:: lastImportTime
34+
.. automethod:: substitutions
35+
.. automethod:: timegridUnits
36+
.. automethod:: students
37+

‎webuntis/objects.py‎

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ def is_current(self):
461461
Boolean, check if this is the current schoolyear::
462462
463463
>>> import webuntis
464-
>>> s = webuntis.Session()
464+
>>> s = webuntis.Session(...).login()
465465
>>> y = s.schoolyears()
466466
>>> y.current.id
467467
7
@@ -552,7 +552,7 @@ class ColorInfo(Result, ColorMixin):
552552
An object containing information about a lesson type or a period code::
553553
554554
>>> import webuntis
555-
>>> s = webuntis.Session()
555+
>>> s = webuntis.Session(...).login()
556556
>>> lstype = s.statusdata().lesson_types[0]
557557
>>> lstype.name
558558
'ls'
@@ -589,7 +589,10 @@ class StatusData(Result):
589589
@lazyproperty
590590
def lesson_types(self):
591591
"""A list of :py:class:`ColorInfo` objects, containing
592-
information about all lesson types defined"""
592+
information about all lesson types defined
593+
594+
:rtype: List[ColorInfo]
595+
"""
593596
return [
594597
ColorInfo(parent=self, data=data)
595598
for data in self._data[u'lstypes']
@@ -598,7 +601,10 @@ def lesson_types(self):
598601
@lazyproperty
599602
def period_codes(self):
600603
"""A list of :py:class:`ColorInfo` objects, containing
601-
information about all period codes defined"""
604+
information about all period codes defined
605+
606+
:rtype: List[ColorInfo]
607+
"""
602608
return [
603609
ColorInfo(parent=self, data=data)
604610
for data in self._data[u'codes']
@@ -613,7 +619,7 @@ def date(self):
613619
"""
614620
get timestamp as python datetime object
615621
616-
:return: timestamp
622+
:return: datetime.datetime
617623
"""
618624
return datetime.datetime.fromtimestamp(self._data / 1000)
619625

@@ -628,12 +634,17 @@ def type(self):
628634
add additional period
629635
shift shifted period
630636
rmchg room change
637+
638+
:rtype: str
631639
"""
632640
return self._data[u'type']
633641

634642
@lazyproperty
635643
def reschedule_start(self):
636-
"""The start of the rescheduled substitution (or None)"""
644+
"""The start of the rescheduled substitution (or None)
645+
646+
:return: datetime.datetime
647+
"""
637648
try:
638649
return datetime_utils.parse_datetime(self._data[u'reschedule'][u'date'],
639650
self._data[u'reschedule'][u'startTime'])
@@ -642,7 +653,10 @@ def reschedule_start(self):
642653

643654
@lazyproperty
644655
def reschedule_end(self):
645-
"""The end of the rescheduled substitution (or None)"""
656+
"""The end of the rescheduled substitution (or None)
657+
658+
:return: datetime.datetime
659+
"""
646660
try:
647661
return datetime_utils.parse_datetime(self._data[u'reschedule'][u'date'],
648662
self._data[u'reschedule'][u'endTime'])

‎webuntis/session.py‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -275,15 +275,15 @@ def statusdata(self):
275275

276276
@result_wrapper
277277
def lastImportTime(self):
278-
"""
278+
"""Information about the last change made.
279279
280280
:rtype: py:class:`webuntis.objects.TimeStampObject`
281281
"""
282282
return objects.TimeStampObject, 'getLatestImportTime', {}
283283

284284
@result_wrapper
285285
def substitutions(self, start, end, departmentId=0):
286-
"""Information about substitutions
286+
"""Get all substitutions.
287287
288288
289289
:type start: :py:class:`datetime.datetime` or :py:class:`datetime.date` or int
@@ -292,8 +292,8 @@ def substitutions(self, start, end, departmentId=0):
292292
:type end: :py:class:`datetime.datetime` or :py:class:`datetime.date` or int
293293
:param end: The end of the time period.
294294
295-
:param departmentId: int
296-
:return:
295+
:param departmentId: int, set to 0 for all departments or if not applicable
296+
297297
:rtype: :py:class:`webuntis.objects.SubstitutionList`
298298
"""
299299

@@ -316,15 +316,16 @@ def substitutions(self, start, end, departmentId=0):
316316

317317
@result_wrapper
318318
def timegridUnits(self):
319-
"""
319+
"""Information about the Timegrid.
320320
321+
:return:
321322
:rtype: :py:class:`webuntis.objects.TimegridObject`
322323
"""
323324
return objects.TimegridObject, 'getTimegridUnits', {}
324325

325326
@result_wrapper
326327
def students(self):
327-
"""
328+
"""Get all students
328329
329330
:rtype: :py:class:`webuntis.objects.StudentsList`
330331
"""

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL