| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -29,3 +29,9 @@ Things you can do with the API | |||
| 29 | 29 | .. automethod:: statusdata | |
| 30 | 30 | .. automethod:: subjects | |
| 31 | 31 | .. automethod:: teachers | |
| 32 | + .. automethod:: statusdata | ||
| 33 | + .. automethod:: lastImportTime | ||
| 34 | + .. automethod:: substitutions | ||
| 35 | + .. automethod:: timegridUnits | ||
| 36 | + .. automethod:: students | ||
| 37 | + | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -461,7 +461,7 @@ def is_current(self): | |||
| 461 | 461 | Boolean, check if this is the current schoolyear:: | |
| 462 | 462 | ||
| 463 | 463 | >>> import webuntis | |
| 464 | - >>> s = webuntis.Session() | ||
| 464 | + >>> s = webuntis.Session(...).login() | ||
| 465 | 465 | >>> y = s.schoolyears() | |
| 466 | 466 | >>> y.current.id | |
| 467 | 467 | 7 | |
@@ -552,7 +552,7 @@ class ColorInfo(Result, ColorMixin): | |||
| 552 | 552 | An object containing information about a lesson type or a period code:: | |
| 553 | 553 | ||
| 554 | 554 | >>> import webuntis | |
| 555 | - >>> s = webuntis.Session() | ||
| 555 | + >>> s = webuntis.Session(...).login() | ||
| 556 | 556 | >>> lstype = s.statusdata().lesson_types[0] | |
| 557 | 557 | >>> lstype.name | |
| 558 | 558 | 'ls' | |
@@ -589,7 +589,10 @@ class StatusData(Result): | |||
| 589 | 589 | @lazyproperty | |
| 590 | 590 | def lesson_types(self): | |
| 591 | 591 | """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 | + """ | ||
| 593 | 596 | return [ | |
| 594 | 597 | ColorInfo(parent=self, data=data) | |
| 595 | 598 | for data in self._data[u'lstypes'] | |
@@ -598,7 +601,10 @@ def lesson_types(self): | |||
| 598 | 601 | @lazyproperty | |
| 599 | 602 | def period_codes(self): | |
| 600 | 603 | """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 | + """ | ||
| 602 | 608 | return [ | |
| 603 | 609 | ColorInfo(parent=self, data=data) | |
| 604 | 610 | for data in self._data[u'codes'] | |
@@ -613,7 +619,7 @@ def date(self): | |||
| 613 | 619 | """ | |
| 614 | 620 | get timestamp as python datetime object | |
| 615 | 621 | ||
| 616 | - :return: timestamp | ||
| 622 | + :return: datetime.datetime | ||
| 617 | 623 | """ | |
| 618 | 624 | return datetime.datetime.fromtimestamp(self._data / 1000) | |
| 619 | 625 | ||
@@ -628,12 +634,17 @@ def type(self): | |||
| 628 | 634 | add additional period | |
| 629 | 635 | shift shifted period | |
| 630 | 636 | rmchg room change | |
| 637 | + | ||
| 638 | + :rtype: str | ||
| 631 | 639 | """ | |
| 632 | 640 | return self._data[u'type'] | |
| 633 | 641 | ||
| 634 | 642 | @lazyproperty | |
| 635 | 643 | 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 | + """ | ||
| 637 | 648 | try: | |
| 638 | 649 | return datetime_utils.parse_datetime(self._data[u'reschedule'][u'date'], | |
| 639 | 650 | self._data[u'reschedule'][u'startTime']) | |
@@ -642,7 +653,10 @@ def reschedule_start(self): | |||
| 642 | 653 | ||
| 643 | 654 | @lazyproperty | |
| 644 | 655 | 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 | + """ | ||
| 646 | 660 | try: | |
| 647 | 661 | return datetime_utils.parse_datetime(self._data[u'reschedule'][u'date'], | |
| 648 | 662 | self._data[u'reschedule'][u'endTime']) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -275,15 +275,15 @@ def statusdata(self): | |||
| 275 | 275 | ||
| 276 | 276 | @result_wrapper | |
| 277 | 277 | def lastImportTime(self): | |
| 278 | - """ | ||
| 278 | + """Information about the last change made. | ||
| 279 | 279 | ||
| 280 | 280 | :rtype: py:class:`webuntis.objects.TimeStampObject` | |
| 281 | 281 | """ | |
| 282 | 282 | return objects.TimeStampObject, 'getLatestImportTime', {} | |
| 283 | 283 | ||
| 284 | 284 | @result_wrapper | |
| 285 | 285 | def substitutions(self, start, end, departmentId=0): | |
| 286 | - """Information about substitutions | ||
| 286 | + """Get all substitutions. | ||
| 287 | 287 | ||
| 288 | 288 | ||
| 289 | 289 | :type start: :py:class:`datetime.datetime` or :py:class:`datetime.date` or int | |
@@ -292,8 +292,8 @@ def substitutions(self, start, end, departmentId=0): | |||
| 292 | 292 | :type end: :py:class:`datetime.datetime` or :py:class:`datetime.date` or int | |
| 293 | 293 | :param end: The end of the time period. | |
| 294 | 294 | ||
| 295 | - :param departmentId: int | ||
| 296 | - :return: | ||
| 295 | + :param departmentId: int, set to 0 for all departments or if not applicable | ||
| 296 | + | ||
| 297 | 297 | :rtype: :py:class:`webuntis.objects.SubstitutionList` | |
| 298 | 298 | """ | |
| 299 | 299 | ||
@@ -316,15 +316,16 @@ def substitutions(self, start, end, departmentId=0): | |||
| 316 | 316 | ||
| 317 | 317 | @result_wrapper | |
| 318 | 318 | def timegridUnits(self): | |
| 319 | - """ | ||
| 319 | + """Information about the Timegrid. | ||
| 320 | 320 | ||
| 321 | + :return: | ||
| 321 | 322 | :rtype: :py:class:`webuntis.objects.TimegridObject` | |
| 322 | 323 | """ | |
| 323 | 324 | return objects.TimegridObject, 'getTimegridUnits', {} | |
| 324 | 325 | ||
| 325 | 326 | @result_wrapper | |
| 326 | 327 | def students(self): | |
| 327 | - """ | ||
| 328 | + """Get all students | ||
| 328 | 329 | ||
| 329 | 330 | :rtype: :py:class:`webuntis.objects.StudentsList` | |
| 330 | 331 | """ | |
| Back | FazBrowse Home | New Git URL |
0 commit comments