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

Improved docs · python-webuntis/python-webuntis@cac7eec · GitHub

Commit cac7eec

Browse files
committed
Improved docs
1 parent cdbd945 commit cac7eec

3 files changed

Lines changed: 14 additions & 11 deletions

File tree

‎examples/html_timetable.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
logging.basicConfig(level=logging.DEBUG)
1111

12-
today = datetime.datetime.today()
12+
today = datetime.date.today()
1313

1414
monday = today - datetime.timedelta(days=today.weekday())
1515
friday = monday + datetime.timedelta(days=4)

‎webuntis/errors.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class MethodNotFoundError(RemoteError):
2424

2525

2626
class AuthError(RemoteError):
27-
'''Errors while authenticating/logging in.'''
27+
'''Errors while logging in.'''
2828
pass
2929

3030

‎webuntis/session.py‎

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,11 @@ def klassen(self, schoolyear=None):
166166
def timetable(self, start, end, **type_and_id):
167167
'''Get the timetable for a specific school class and time period.
168168
169-
:param start: The beginning of the time period. Can be a
170-
:py:class:`datetime.datetime` object or a string of the format
171-
``YYMMDD``.
169+
:type start: :py:class:`datetime.datetime` or :py:class:`datetime.date`
170+
:param start: The beginning of the time period.
172171
173-
:param end: The end of the time period, same type as ``start``.
172+
:type end: :py:class:`datetime.datetime` or :py:class:`datetime.date`
173+
:param end: The end of the time period.
174174
175175
:rtype: :py:class:`webuntis.objects.PeriodList`
176176
@@ -336,11 +336,14 @@ class Session(JSONRPCSession, ResultWrapperMixin):
336336
s.timetable(klasse=123) # fetch data again, override old value
337337
s.timetable(klasse=123, from_cache=True) # get directly from cache
338338
339-
The reason this cache was added is because the API doesn't allow you to
340-
fetch information for e.g. a single teacher. It would seriously harm
341-
performance to fetch the whole list each time we want information about
342-
a teacher. Without the cache, i experienced a performance decrease
343-
about twenty seconds, so i wouldn't set the ``cachelen`` to ``0``.
339+
The reason this cache was added is that the API only allows you to
340+
fetch a whole list of objects (teachers/schoolclasses/...), not single
341+
ones. It would seriously harm performance to fetch the whole list each
342+
time we want information about a single object. Without the cache, i
343+
sometimes experienced a performance decrease about twenty seconds, so i
344+
wouldn't set the ``cachelen`` to anything smaller than ``5``.
345+
346+
Default value is ``20``.
344347
345348
You can clear the cache using::
346349

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL