| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,7 +9,7 @@ | |||
| 9 | 9 | ||
| 10 | 10 | logging.basicConfig(level=logging.DEBUG) | |
| 11 | 11 | ||
| 12 | - today = datetime.datetime.today() | ||
| 12 | + today = datetime.date.today() | ||
| 13 | 13 | ||
| 14 | 14 | monday = today - datetime.timedelta(days=today.weekday()) | |
| 15 | 15 | friday = monday + datetime.timedelta(days=4) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,7 +24,7 @@ class MethodNotFoundError(RemoteError): | |||
| 24 | 24 | ||
| 25 | 25 | ||
| 26 | 26 | class AuthError(RemoteError): | |
| 27 | - '''Errors while authenticating/logging in.''' | ||
| 27 | + '''Errors while logging in.''' | ||
| 28 | 28 | pass | |
| 29 | 29 | ||
| 30 | 30 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -166,11 +166,11 @@ def klassen(self, schoolyear=None): | |||
| 166 | 166 | def timetable(self, start, end, **type_and_id): | |
| 167 | 167 | '''Get the timetable for a specific school class and time period. | |
| 168 | 168 | ||
| 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. | ||
| 172 | 171 | ||
| 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. | ||
| 174 | 174 | ||
| 175 | 175 | :rtype: :py:class:`webuntis.objects.PeriodList` | |
| 176 | 176 | ||
@@ -336,11 +336,14 @@ class Session(JSONRPCSession, ResultWrapperMixin): | |||
| 336 | 336 | s.timetable(klasse=123) # fetch data again, override old value | |
| 337 | 337 | s.timetable(klasse=123, from_cache=True) # get directly from cache | |
| 338 | 338 | ||
| 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``. | ||
| 344 | 347 | ||
| 345 | 348 | You can clear the cache using:: | |
| 346 | 349 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments