librus-python-api 1.11.3__tar.gz → 1.11.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/API.md +11 -2
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/CHANGELOG.md +52 -0
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/PKG-INFO +9 -4
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/README.md +8 -3
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/__init__.py +1 -1
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/attendance_frequency.py +8 -38
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/completed_lessons.py +4 -0
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/config.py +7 -1
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/diagnostics.py +18 -4
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/exceptions.py +3 -1
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/markup.py +10 -3
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/models.py +4 -1
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/parsers.py +54 -2
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/service.py +62 -18
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/transport.py +9 -0
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/uv.lock +24 -24
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/.gitignore +0 -0
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/LICENSE +0 -0
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/SECURITY.md +0 -0
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/pyproject.toml +0 -0
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/_notification_bootstrap.py +0 -0
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/_notification_codec.py +0 -0
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/_storage.py +0 -0
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/_windows_filesystem.py +0 -0
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/announcements.py +0 -0
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/attachment_routes.py +0 -0
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/attachments.py +0 -0
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/attendance.py +0 -0
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/budget.py +0 -0
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/checkpoint.py +0 -0
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/class_free_days.py +0 -0
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/detail_fields.py +0 -0
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/files.py +0 -0
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/formative_grades.py +0 -0
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/gateway_grades.py +0 -0
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/grade_parsers.py +0 -0
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/grade_records.py +0 -0
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/homework_range.py +0 -0
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/inspect_page.py +0 -0
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/justifications.py +0 -0
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/lifecycle.py +0 -0
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/message_content.py +0 -0
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/messages.py +0 -0
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/modern_body.py +0 -0
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/modern_mailbox.py +0 -0
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/modern_messages.py +0 -0
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/notification_models.py +0 -0
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/notification_persistence.py +0 -0
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/notification_workflow.py +0 -0
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/notifications.py +0 -0
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/parsing.py +0 -0
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/persistence.py +0 -0
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/py.typed +0 -0
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/recipients.py +0 -0
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/scheduler.py +0 -0
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/school_reads.py +0 -0
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/school_year_archive.py +0 -0
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/sending.py +0 -0
- {librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/timetable.py +0 -0
|
@@ -191,6 +191,11 @@ from the exception's own traceback. Neither raises.
|
|
|
191
191
|
tr.bolded.line0[2] > td.center[7]; cells 7, columns 11, width 10, span 1`.
|
|
192
192
|
It holds structure and counts only, at most 512 characters, so an
|
|
193
193
|
application can return it with the error, as `librus-mcp` does in `at`.
|
|
194
|
+
Since 1.11.4 a gateway JSON envelope that fails validation gives its field
|
|
195
|
+
path and rule instead, such as `wire Attendances[3].Lesson missing`: wire
|
|
196
|
+
field names, list indexes and pydantic error types only, never a value (a
|
|
197
|
+
path part that is not a field name shows as `?`). `describe_failure` returns
|
|
198
|
+
the same line. The attendance frequency reads use it so far.
|
|
194
199
|
- `python -m librus_python_api.inspect_page {grades,final-grades,profile} FILE`
|
|
195
200
|
parses a saved page offline (a whole page or a copied table) and prints
|
|
196
201
|
counts, or the failure kind, frames and structure. `profile` (1.8.1) reads the
|
|
@@ -435,7 +440,9 @@ school's login. See [gateway descriptive grades](contracts/grades.md#gateway-des
|
|
|
435
440
|
- `attendance_detail(detail_id)` takes a numeric string and returns ordered
|
|
436
441
|
`fields`, `notes` and stable-key `normalized_fields` (see below).
|
|
437
442
|
- `gateway_attendance()` returns the JSON records with a strict `AttendanceKind`
|
|
438
|
-
per stable type ID; unknown IDs stay `UNKNOWN`.
|
|
443
|
+
per stable type ID; unknown IDs stay `UNKNOWN`. A record's `identifier` is an
|
|
444
|
+
opaque token of up to 64 printable ASCII characters, not always digits
|
|
445
|
+
(1.11.5); it only detects duplicate records.
|
|
439
446
|
- `attendance_frequency()` returns per-semester and overall `FrequencyMeasure`
|
|
440
447
|
(attended, total, excluded and unknown counts, plus `ratio` in 0..1 or `None`).
|
|
441
448
|
Unknown types or an empty denominator give `ratio=None`, never 100 %.
|
|
@@ -466,7 +473,9 @@ by default; entries sent before `window_start` may be missing. Only a login
|
|
|
466
473
|
whose identity response reports `Me.Account.GroupId` 5 (both parent logins
|
|
467
474
|
observed) sends the request; any other or missing group (8 on both student
|
|
468
475
|
logins, where the page ends the session) raises `UnsupportedCapabilityError`
|
|
469
|
-
without it.
|
|
476
|
+
without it. A parent login that still gets the logged-out page right after
|
|
477
|
+
signing in raises `ViewDisabledError` (1.11.4) and its session is cleared. See
|
|
478
|
+
[contract](contracts/justifications.md).
|
|
470
479
|
|
|
471
480
|
### Weekly timetable
|
|
472
481
|
|
|
@@ -1,5 +1,57 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.11.5 (2026-11-23) - Parent logins: attendance frequency and long grade tooltips
|
|
4
|
+
|
|
5
|
+
The two failures left on a tester's parent login (librus-mcp#136):
|
|
6
|
+
|
|
7
|
+
- Attendance frequency: some gateway attendance records carry an ID that is not
|
|
8
|
+
a number, and `attendance_frequency()` and `subject_frequency()` failed with
|
|
9
|
+
`ParseError`. The shape was not shown; another Librus client strips
|
|
10
|
+
non-digits from this ID. The ID is now an opaque token of 1 to 64 printable ASCII
|
|
11
|
+
characters. It only detects duplicate records; nothing else reads it.
|
|
12
|
+
- Grades: the 32-field bound on a grade tooltip counted lines, blank ones
|
|
13
|
+
included, and a descriptive grade's tooltip with more than 32 lines failed
|
|
14
|
+
the whole grades read with `LimitError`. Most likely its free text spans
|
|
15
|
+
many lines. The bound now counts fields; non-blank lines have a bound of
|
|
16
|
+
their own, 256, and the 8192-character bound still applies.
|
|
17
|
+
|
|
18
|
+
## 1.11.4 (2026-11-23) - Parent logins: messages, e-Justifications, grade tooltips; audit fixes
|
|
19
|
+
|
|
20
|
+
Four failures from a tester's parent login (librus-mcp#136, #201):
|
|
21
|
+
|
|
22
|
+
- Modern messages: opening `/eusprawiedliwienia` ends a Synergia session, and
|
|
23
|
+
the messages sign-in then got Synergia's logged-out page instead of a
|
|
24
|
+
redirect. Every message read failed with `UnsupportedCapabilityError` until
|
|
25
|
+
the process restarted. That page now counts as an expired session: a read
|
|
26
|
+
signs in again once and continues. A send still fails as `SessionExpiredError`
|
|
27
|
+
without being dispatched and never signs in again by itself.
|
|
28
|
+
- e-Justifications: a parent login that still gets the logged-out page right
|
|
29
|
+
after signing in raises `ViewDisabledError` instead of `ParseError`, and its
|
|
30
|
+
session is cleared so the next read signs in again. The operation's cooldown
|
|
31
|
+
still applies, so repeated calls do not sign in again each time.
|
|
32
|
+
- Grades: in a descriptive grade's tooltip, `Umiejętność` and `Obszar
|
|
33
|
+
oceniania` may continue on unlabelled lines, as `Komentarz` does. A skill that
|
|
34
|
+
wrapped onto a line of its own failed the whole grades read.
|
|
35
|
+
- Diagnostics: when a gateway JSON envelope fails validation,
|
|
36
|
+
`failure_locator` and `describe_failure` name the field path and rule, such as
|
|
37
|
+
`wire Attendances[3].Lesson missing`, with no values. Attendance frequency
|
|
38
|
+
reads use it; the tester's attendance list fails on a field that the next run
|
|
39
|
+
will name.
|
|
40
|
+
|
|
41
|
+
Three bugs from the weekly audit:
|
|
42
|
+
|
|
43
|
+
- Grades: when gateway grades are merged into the page's records, behaviour-point
|
|
44
|
+
entries now count toward `GRADE_MAX_RECORDS`, as they do in the page parser
|
|
45
|
+
(#195). The merged result could exceed the bound before.
|
|
46
|
+
- Completed lessons: a `Pozycje A..B z T` range must agree with the page count
|
|
47
|
+
(#196). A last page that ends before the total, a first page that does not
|
|
48
|
+
start at item 1, or an earlier page that already ends at the total raises
|
|
49
|
+
`ParseError` instead of returning a partial list as complete.
|
|
50
|
+
- Attendance: `subject_frequency()` no longer raises `LimitError` above 256
|
|
51
|
+
distinct lessons or subjects (#199). The lesson and subject collections
|
|
52
|
+
resolve every row the 2048-row cap allows. Without a collection, lookups that
|
|
53
|
+
would exceed the request budget fail before any is sent.
|
|
54
|
+
|
|
3
55
|
## 1.11.3 (2026-11-22) - Behaviour points never read as a final grade
|
|
4
56
|
|
|
5
57
|
- Grades: `final_grades()` no longer reads a summary value from a merged
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: librus-python-api
|
|
3
|
-
Version: 1.11.
|
|
3
|
+
Version: 1.11.5
|
|
4
4
|
Summary: Independent bounded async Librus Synergia client
|
|
5
5
|
Project-URL: Repository, https://github.com/krzysztofbury/librus-python-api
|
|
6
6
|
Project-URL: Issues, https://github.com/krzysztofbury/librus-python-api/issues
|
|
@@ -42,7 +42,12 @@ private ACLs. Windows installations include `pywin32` and `tzdata` automatically
|
|
|
42
42
|
Network paths, reparse-point paths and unsafe storage permissions fail closed.
|
|
43
43
|
See [platform requirements](contracts/persistence.md#windows-disk-boundary-25).
|
|
44
44
|
|
|
45
|
-
**Status:** `1.11.
|
|
45
|
+
**Status:** `1.11.5` reads gateway attendance records whose ID is not a
|
|
46
|
+
number and grade tooltips longer than 32 lines. `1.11.4` recovers the messages sign-in after a page that ended the
|
|
47
|
+
session, reports e-Justifications switched off for a parent login as
|
|
48
|
+
`ViewDisabledError`, reads descriptive grade skills that wrap onto a second
|
|
49
|
+
tooltip line and names the failing field of a gateway JSON envelope.
|
|
50
|
+
`1.11.3` never returns behaviour points as a final grade when the
|
|
46
51
|
behaviour row's cells are merged differently. `1.11.2` reads a behaviour row whose last cell spans past the
|
|
47
52
|
grade table and names the failing cell in diagnostics. `1.11.1` fixes a Windows store shared by several processes
|
|
48
53
|
reporting `StorageError`, also after a dispatched send. `1.11.0` raises `TemporarilyUnavailableError` for the archive's
|
|
@@ -85,7 +90,7 @@ See [limitations](#supported-features-and-limitations) below.
|
|
|
85
90
|
Install the exact release from PyPI after its gated publication completes:
|
|
86
91
|
|
|
87
92
|
```sh
|
|
88
|
-
python -m pip install librus-python-api==1.11.
|
|
93
|
+
python -m pip install librus-python-api==1.11.5
|
|
89
94
|
```
|
|
90
95
|
|
|
91
96
|
Pin the exact version qualified by your application. Before publication, use a
|
|
@@ -101,7 +106,7 @@ python -m pip install .
|
|
|
101
106
|
To install a locally built wheel instead:
|
|
102
107
|
|
|
103
108
|
```sh
|
|
104
|
-
python -m pip install ./dist/librus_python_api-1.11.
|
|
109
|
+
python -m pip install ./dist/librus_python_api-1.11.5-py3-none-any.whl
|
|
105
110
|
```
|
|
106
111
|
|
|
107
112
|
No console script or background process is installed: import the library in your
|
|
@@ -16,7 +16,12 @@ private ACLs. Windows installations include `pywin32` and `tzdata` automatically
|
|
|
16
16
|
Network paths, reparse-point paths and unsafe storage permissions fail closed.
|
|
17
17
|
See [platform requirements](contracts/persistence.md#windows-disk-boundary-25).
|
|
18
18
|
|
|
19
|
-
**Status:** `1.11.
|
|
19
|
+
**Status:** `1.11.5` reads gateway attendance records whose ID is not a
|
|
20
|
+
number and grade tooltips longer than 32 lines. `1.11.4` recovers the messages sign-in after a page that ended the
|
|
21
|
+
session, reports e-Justifications switched off for a parent login as
|
|
22
|
+
`ViewDisabledError`, reads descriptive grade skills that wrap onto a second
|
|
23
|
+
tooltip line and names the failing field of a gateway JSON envelope.
|
|
24
|
+
`1.11.3` never returns behaviour points as a final grade when the
|
|
20
25
|
behaviour row's cells are merged differently. `1.11.2` reads a behaviour row whose last cell spans past the
|
|
21
26
|
grade table and names the failing cell in diagnostics. `1.11.1` fixes a Windows store shared by several processes
|
|
22
27
|
reporting `StorageError`, also after a dispatched send. `1.11.0` raises `TemporarilyUnavailableError` for the archive's
|
|
@@ -59,7 +64,7 @@ See [limitations](#supported-features-and-limitations) below.
|
|
|
59
64
|
Install the exact release from PyPI after its gated publication completes:
|
|
60
65
|
|
|
61
66
|
```sh
|
|
62
|
-
python -m pip install librus-python-api==1.11.
|
|
67
|
+
python -m pip install librus-python-api==1.11.5
|
|
63
68
|
```
|
|
64
69
|
|
|
65
70
|
Pin the exact version qualified by your application. Before publication, use a
|
|
@@ -75,7 +80,7 @@ python -m pip install .
|
|
|
75
80
|
To install a locally built wheel instead:
|
|
76
81
|
|
|
77
82
|
```sh
|
|
78
|
-
python -m pip install ./dist/librus_python_api-1.11.
|
|
83
|
+
python -m pip install ./dist/librus_python_api-1.11.5-py3-none-any.whl
|
|
79
84
|
```
|
|
80
85
|
|
|
81
86
|
No console script or background process is installed: import the library in your
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""Independent bounded async client. General live compatibility is unqualified."""
|
|
2
2
|
|
|
3
3
|
# Before the imports: config reads it for the User-Agent.
|
|
4
|
-
__version__ = "1.11.
|
|
4
|
+
__version__ = "1.11.5"
|
|
5
5
|
|
|
6
6
|
from librus_python_api.attachments import AttachmentStream, ModernAttachmentStream
|
|
7
7
|
from librus_python_api.budget import RequestBudget
|
{librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/attendance_frequency.py
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Original validated gateway parsing and explicit attendance ratio policies."""
|
|
2
2
|
|
|
3
|
-
from pydantic import BaseModel
|
|
3
|
+
from pydantic import BaseModel
|
|
4
4
|
|
|
5
5
|
from librus_python_api import markup
|
|
6
6
|
from librus_python_api.config import (
|
|
@@ -20,7 +20,7 @@ from librus_python_api.models import (
|
|
|
20
20
|
_SubjectEnvelopeWire,
|
|
21
21
|
_SubjectsEnvelopeWire,
|
|
22
22
|
)
|
|
23
|
-
from librus_python_api.parsers import decode_json
|
|
23
|
+
from librus_python_api.parsers import decode_json, validate_wire
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
def parse_gateway_attendance(body: bytes) -> tuple[GatewayAttendanceRecord, ...]:
|
|
@@ -31,14 +31,7 @@ def parse_gateway_attendance(body: bytes) -> tuple[GatewayAttendanceRecord, ...]
|
|
|
31
31
|
and len(data["Attendances"]) > ATTENDANCE_MAX_RECORDS
|
|
32
32
|
):
|
|
33
33
|
raise LibrusError(ErrorKind.LIMIT)
|
|
34
|
-
|
|
35
|
-
envelope = None
|
|
36
|
-
try:
|
|
37
|
-
envelope = _AttendanceEnvelopeWire.model_validate(data)
|
|
38
|
-
except ValidationError:
|
|
39
|
-
failed = True
|
|
40
|
-
if failed or envelope is None:
|
|
41
|
-
raise LibrusError(ErrorKind.PARSE)
|
|
34
|
+
envelope = validate_wire(_AttendanceEnvelopeWire, data)
|
|
42
35
|
seen: set[str] = set()
|
|
43
36
|
records: list[GatewayAttendanceRecord] = []
|
|
44
37
|
for row in envelope.Attendances:
|
|
@@ -62,31 +55,16 @@ def parse_gateway_attendance(body: bytes) -> tuple[GatewayAttendanceRecord, ...]
|
|
|
62
55
|
|
|
63
56
|
def parse_lesson_subject(body: bytes, identifier: str) -> str:
|
|
64
57
|
data = decode_json(body)
|
|
65
|
-
|
|
66
|
-
lesson
|
|
67
|
-
try:
|
|
68
|
-
lesson = _LessonEnvelopeWire.model_validate(data).Lesson
|
|
69
|
-
except ValidationError:
|
|
70
|
-
failed = True
|
|
71
|
-
if failed or lesson is None or lesson.Id != identifier:
|
|
58
|
+
lesson = validate_wire(_LessonEnvelopeWire, data).Lesson
|
|
59
|
+
if lesson.Id != identifier:
|
|
72
60
|
raise LibrusError(ErrorKind.PARSE)
|
|
73
61
|
return lesson.Subject.Id
|
|
74
62
|
|
|
75
63
|
|
|
76
64
|
def parse_subject_name(body: bytes, identifier: str) -> str:
|
|
77
65
|
data = decode_json(body)
|
|
78
|
-
|
|
79
|
-
subject
|
|
80
|
-
try:
|
|
81
|
-
subject = _SubjectEnvelopeWire.model_validate(data).Subject
|
|
82
|
-
except ValidationError:
|
|
83
|
-
failed = True
|
|
84
|
-
if (
|
|
85
|
-
failed
|
|
86
|
-
or subject is None
|
|
87
|
-
or subject.Id != identifier
|
|
88
|
-
or not subject.Name.strip()
|
|
89
|
-
):
|
|
66
|
+
subject = validate_wire(_SubjectEnvelopeWire, data).Subject
|
|
67
|
+
if subject.Id != identifier or not subject.Name.strip():
|
|
90
68
|
raise LibrusError(ErrorKind.PARSE)
|
|
91
69
|
return subject.Name.strip()
|
|
92
70
|
|
|
@@ -98,15 +76,7 @@ def _collection[M: BaseModel](data: object, key: str, maximum: int, wire: type[M
|
|
|
98
76
|
and len(data[key]) > maximum
|
|
99
77
|
):
|
|
100
78
|
raise LibrusError(ErrorKind.LIMIT)
|
|
101
|
-
|
|
102
|
-
envelope = None
|
|
103
|
-
try:
|
|
104
|
-
envelope = wire.model_validate(data)
|
|
105
|
-
except ValidationError:
|
|
106
|
-
failed = True
|
|
107
|
-
if failed or envelope is None:
|
|
108
|
-
raise LibrusError(ErrorKind.PARSE)
|
|
109
|
-
return envelope
|
|
79
|
+
return validate_wire(wire, data)
|
|
110
80
|
|
|
111
81
|
|
|
112
82
|
def _unique(pairs: list[tuple[str, str]]) -> dict[str, str]:
|
{librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/completed_lessons.py
RENAMED
|
@@ -103,6 +103,10 @@ def _pagination(document: html.HtmlElement, page: int) -> tuple[int, int | None]
|
|
|
103
103
|
first, last, total = int(match[3]), int(match[4]), int(match[5])
|
|
104
104
|
if not 1 <= first <= last <= total:
|
|
105
105
|
raise LibrusError(ErrorKind.PARSE)
|
|
106
|
+
# The range must agree with the page count (#196): the first page starts
|
|
107
|
+
# at the first item, only the last page ends at the total.
|
|
108
|
+
if (current == 1 and first != 1) or ((current == count) != (last == total)):
|
|
109
|
+
raise LibrusError(ErrorKind.PARSE)
|
|
106
110
|
return count, last - first + 1
|
|
107
111
|
|
|
108
112
|
|
|
@@ -737,7 +737,10 @@ GRADE_INLINE_DETAIL_LABEL = "Ocena"
|
|
|
737
737
|
# Tooltip fields whose free text may continue on unlabelled lines. A teacher's
|
|
738
738
|
# multi-line grade comment was observed on 2026-10-27. A formative mirror's
|
|
739
739
|
# assessment text after `Ocena` also spans lines (2026-11-08, markup.py).
|
|
740
|
-
|
|
740
|
+
# In a descriptive grade the skill after `Umiejętność` wrapped onto a line of
|
|
741
|
+
# its own (librus-mcp#136); its sibling `Obszar oceniania` is the same kind of
|
|
742
|
+
# curriculum text and continues the same way.
|
|
743
|
+
TOOLTIP_MULTILINE_LABELS = frozenset({"Komentarz", "Obszar oceniania", "Umiejętność"})
|
|
741
744
|
# Labels a tooltip may repeat. In the week view a correction listed
|
|
742
745
|
# `Poprawa oceny` twice, both naming the same original grade, the first ending
|
|
743
746
|
# in a comma; the all view showed it once (2026-11-08). The tooltip is no
|
|
@@ -804,6 +807,9 @@ GRADE_POINT_RESULT_PERIODS = MappingProxyType({"I": 1, "II": 2, "R": 0})
|
|
|
804
807
|
GRADE_MAX_RECORDS = 2048
|
|
805
808
|
GRADE_MAX_METADATA_LENGTH = 8192
|
|
806
809
|
GRADE_MAX_METADATA_FIELDS = 32
|
|
810
|
+
# Non-blank tooltip lines. Free text may span more lines than the tooltip has
|
|
811
|
+
# fields (librus-mcp#136); each line is parsed on its own, so lines stay bounded.
|
|
812
|
+
GRADE_MAX_METADATA_LINES = 256
|
|
807
813
|
GRADE_MAX_WINDOW_DAYS = 371
|
|
808
814
|
GRADE_PERIOD_HEADERS = MappingProxyType(
|
|
809
815
|
{
|
|
@@ -15,6 +15,7 @@ from typing import Protocol
|
|
|
15
15
|
|
|
16
16
|
from lxml import html
|
|
17
17
|
|
|
18
|
+
from librus_python_api.exceptions import ParseError
|
|
18
19
|
from librus_python_api.models import DiagnosticEvent
|
|
19
20
|
|
|
20
21
|
_PACKAGE = "librus_python_api"
|
|
@@ -532,6 +533,14 @@ def _failure_site(
|
|
|
532
533
|
return None
|
|
533
534
|
|
|
534
535
|
|
|
536
|
+
def _wire_failure(error: BaseException) -> str | None:
|
|
537
|
+
"""Where a JSON envelope failed validation (`parsers.validate_wire`)."""
|
|
538
|
+
for failure in _chain(error):
|
|
539
|
+
if isinstance(failure, ParseError) and failure._wire_failure:
|
|
540
|
+
return f"wire {failure._wire_failure}"
|
|
541
|
+
return None
|
|
542
|
+
|
|
543
|
+
|
|
535
544
|
def describe_failure(error: BaseException) -> str | None:
|
|
536
545
|
"""The page structure around a failure, for a bug report.
|
|
537
546
|
|
|
@@ -539,13 +548,15 @@ def describe_failure(error: BaseException) -> str | None:
|
|
|
539
548
|
any: tags, safe class tokens, known tooltip labels, known link families
|
|
540
549
|
and lengths, then the layout counts it compared (such as `width`). A
|
|
541
550
|
whole page is summarized last (see _page_summary). Text and attribute
|
|
542
|
-
values are masked unless they equal a parser constant.
|
|
551
|
+
values are masked unless they equal a parser constant. A JSON envelope
|
|
552
|
+
that failed validation is named by field path and rule instead.
|
|
543
553
|
Returns None when there is nothing to show; never raises.
|
|
544
554
|
"""
|
|
545
555
|
try:
|
|
546
556
|
site = _failure_site(error)
|
|
547
557
|
if site is None:
|
|
548
|
-
|
|
558
|
+
wire = _wire_failure(error)
|
|
559
|
+
return None if wire is None else wire[:_REPORT_BYTES]
|
|
549
560
|
frame, line, elements, sequences, counts = site
|
|
550
561
|
redactor = _Redactor()
|
|
551
562
|
lines = [f"at {_site(frame, line)}"]
|
|
@@ -583,12 +594,15 @@ def failure_locator(error: BaseException) -> str | None:
|
|
|
583
594
|
`describe_failure`), then the sizes it was checked against, for example
|
|
584
595
|
`table.stretch.decorated[1] > tbody[1] > tr.bolded.line0[2] > td.center[7];
|
|
585
596
|
cells 7, columns 11, width 10`. Structure and counts only, never page text
|
|
586
|
-
or values.
|
|
597
|
+
or values. A JSON envelope that failed validation gives its field path and
|
|
598
|
+
rule, for example `wire Attendances[3].Lesson missing`. Returns None when
|
|
599
|
+
neither is involved; never raises.
|
|
587
600
|
"""
|
|
588
601
|
try:
|
|
589
602
|
site = _failure_site(error)
|
|
590
603
|
if site is None:
|
|
591
|
-
|
|
604
|
+
wire = _wire_failure(error)
|
|
605
|
+
return None if wire is None else wire[:_LOCATOR_BYTES]
|
|
592
606
|
_, _, elements, sequences, counts = site
|
|
593
607
|
redactor = _Redactor()
|
|
594
608
|
parts = [
|
|
@@ -151,7 +151,9 @@ class LimitError(LibrusError):
|
|
|
151
151
|
|
|
152
152
|
|
|
153
153
|
class ParseError(LibrusError):
|
|
154
|
-
|
|
154
|
+
# Library-private: where a JSON envelope failed validation, as wire field
|
|
155
|
+
# names, list indexes and pydantic error types only (`wire_failure`).
|
|
156
|
+
_wire_failure: str | None = None
|
|
155
157
|
|
|
156
158
|
|
|
157
159
|
class StaleCursorError(LibrusError):
|
|
@@ -13,6 +13,7 @@ from librus_python_api.config import (
|
|
|
13
13
|
GRADE_MAX_COLUMNS,
|
|
14
14
|
GRADE_MAX_METADATA_FIELDS,
|
|
15
15
|
GRADE_MAX_METADATA_LENGTH,
|
|
16
|
+
GRADE_MAX_METADATA_LINES,
|
|
16
17
|
TOOLTIP_LABELS,
|
|
17
18
|
TOOLTIP_MULTILINE_LABELS,
|
|
18
19
|
TOOLTIP_REPEATABLE_LABELS,
|
|
@@ -110,10 +111,14 @@ def tooltip_fields(
|
|
|
110
111
|
raise LibrusError(ErrorKind.LIMIT)
|
|
111
112
|
result: dict[str, str] = {}
|
|
112
113
|
last: str | None = None
|
|
113
|
-
|
|
114
|
-
|
|
114
|
+
# Fields and lines are bounded apart: free text may span more lines than
|
|
115
|
+
# there are fields, and blank lines count toward neither (librus-mcp#136).
|
|
116
|
+
chunks = [
|
|
117
|
+
chunk for chunk in re.split(r"<br\s*/?>|\n", title, flags=re.I) if chunk.strip()
|
|
118
|
+
]
|
|
119
|
+
if len(chunks) > GRADE_MAX_METADATA_LINES:
|
|
115
120
|
raise LibrusError(ErrorKind.LIMIT)
|
|
116
|
-
lines = [tooltip_line(chunk) for chunk in chunks
|
|
121
|
+
lines = [tooltip_line(chunk) for chunk in chunks]
|
|
117
122
|
# Start of the closing run of known-label lines, such as Kategoria, Data.
|
|
118
123
|
closing = len(lines)
|
|
119
124
|
while closing and _known_label(lines[closing - 1]):
|
|
@@ -143,6 +148,8 @@ def tooltip_fields(
|
|
|
143
148
|
continue
|
|
144
149
|
if not separator or not key or key in result:
|
|
145
150
|
raise LibrusError(ErrorKind.PARSE)
|
|
151
|
+
if len(result) == GRADE_MAX_METADATA_FIELDS:
|
|
152
|
+
raise LibrusError(ErrorKind.LIMIT)
|
|
146
153
|
result[key] = value
|
|
147
154
|
last = key
|
|
148
155
|
return result
|
|
@@ -1422,7 +1422,10 @@ class _NumericReferenceWire(BaseModel):
|
|
|
1422
1422
|
|
|
1423
1423
|
class _AttendanceWire(BaseModel):
|
|
1424
1424
|
model_config = ConfigDict(strict=True, extra="ignore", hide_input_in_errors=True)
|
|
1425
|
-
|
|
1425
|
+
# Opaque: a parent login's rows failed a digits-only pattern (librus-mcp#136,
|
|
1426
|
+
# shape unseen). szkolny-android strips non-digits from this ID, which
|
|
1427
|
+
# suggests a prefix such as `t`. It only detects duplicate rows.
|
|
1428
|
+
Id: Annotated[str | None, Field(pattern=r"^[!-~]{1,64}$")] = None
|
|
1426
1429
|
Date: Annotated[str, Field(pattern=r"^[0-9]{4}-[0-9]{2}-[0-9]{2}$")]
|
|
1427
1430
|
Semester: Literal[1, 2]
|
|
1428
1431
|
Type: _NumericReferenceWire
|
|
@@ -3,12 +3,13 @@
|
|
|
3
3
|
import json
|
|
4
4
|
import math
|
|
5
5
|
import re
|
|
6
|
+
import typing
|
|
6
7
|
from html import unescape
|
|
7
8
|
from html.entities import html5
|
|
8
9
|
from typing import Any
|
|
9
10
|
|
|
10
11
|
from lxml import etree, html
|
|
11
|
-
from pydantic import ValidationError
|
|
12
|
+
from pydantic import BaseModel, ValidationError
|
|
12
13
|
|
|
13
14
|
from librus_python_api.config import (
|
|
14
15
|
LOGGED_IN_PAGE_MARKER,
|
|
@@ -18,7 +19,7 @@ from librus_python_api.config import (
|
|
|
18
19
|
PROFILE_LUCKY_NUMBER_CLASS,
|
|
19
20
|
PROFILE_LUCKY_NUMBER_DISABLED,
|
|
20
21
|
)
|
|
21
|
-
from librus_python_api.exceptions import ErrorKind, LibrusError
|
|
22
|
+
from librus_python_api.exceptions import ErrorKind, LibrusError, ParseError
|
|
22
23
|
from librus_python_api.models import (
|
|
23
24
|
Availability,
|
|
24
25
|
LuckyNumber,
|
|
@@ -264,6 +265,57 @@ def parse_page(body: bytes, *, repeatable_id: str | None = None) -> html.HtmlEle
|
|
|
264
265
|
return document
|
|
265
266
|
|
|
266
267
|
|
|
268
|
+
def _wire_names(model: type[BaseModel], seen: set[type[BaseModel]]) -> set[str]:
|
|
269
|
+
"""Every field name of a wire model and the models nested in it."""
|
|
270
|
+
if model in seen:
|
|
271
|
+
return set()
|
|
272
|
+
seen.add(model)
|
|
273
|
+
names: set[str] = set()
|
|
274
|
+
for name, field in model.model_fields.items():
|
|
275
|
+
names.add(name)
|
|
276
|
+
if field.alias:
|
|
277
|
+
names.add(field.alias)
|
|
278
|
+
pending: list[object] = [field.annotation]
|
|
279
|
+
while pending:
|
|
280
|
+
kind = pending.pop()
|
|
281
|
+
if isinstance(kind, type) and issubclass(kind, BaseModel):
|
|
282
|
+
names |= _wire_names(kind, seen)
|
|
283
|
+
pending.extend(typing.get_args(kind))
|
|
284
|
+
return names
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
def wire_failure(error: ValidationError, model: type[BaseModel]) -> str:
|
|
288
|
+
"""Where a wire model rejected a body: field path and rule, never a value.
|
|
289
|
+
|
|
290
|
+
A path part is shown only when it is a list index or a field name of
|
|
291
|
+
`model`; anything else (such as a dict key from the body) is `?`.
|
|
292
|
+
"""
|
|
293
|
+
names = _wire_names(model, set())
|
|
294
|
+
errors = error.errors(include_url=False, include_context=False, include_input=False)
|
|
295
|
+
shown: list[str] = []
|
|
296
|
+
for item in errors[:3]:
|
|
297
|
+
path = ""
|
|
298
|
+
for part in item["loc"]:
|
|
299
|
+
if type(part) is int:
|
|
300
|
+
path += f"[{part}]"
|
|
301
|
+
else:
|
|
302
|
+
path += ("." if path else "") + (part if part in names else "?")
|
|
303
|
+
shown.append(f"{path or '(body)'} {item['type']}")
|
|
304
|
+
more = f"; {len(errors)} errors" if len(errors) > 3 else ""
|
|
305
|
+
return "; ".join(shown) + more
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
def validate_wire[M: BaseModel](model: type[M], data: object) -> M:
|
|
309
|
+
"""`model` validated from decoded JSON; PARSE naming the failing field."""
|
|
310
|
+
try:
|
|
311
|
+
return model.model_validate(data)
|
|
312
|
+
except ValidationError as error:
|
|
313
|
+
failure = wire_failure(error, model)
|
|
314
|
+
parse = ParseError(ErrorKind.PARSE)
|
|
315
|
+
parse._wire_failure = failure
|
|
316
|
+
raise parse
|
|
317
|
+
|
|
318
|
+
|
|
267
319
|
def is_logged_out_page(body: bytes) -> bool:
|
|
268
320
|
"""Synergia's page for a session it no longer knows; never raises."""
|
|
269
321
|
if LOGGED_OUT_HEADING.encode() not in body:
|
|
@@ -8,7 +8,7 @@ import json
|
|
|
8
8
|
import math
|
|
9
9
|
import re
|
|
10
10
|
import time
|
|
11
|
-
from collections.abc import Awaitable, Callable, Hashable, Mapping
|
|
11
|
+
from collections.abc import Awaitable, Callable, Hashable, Iterable, Mapping
|
|
12
12
|
from dataclasses import dataclass, replace
|
|
13
13
|
from datetime import UTC, date, datetime
|
|
14
14
|
from types import MappingProxyType, TracebackType
|
|
@@ -397,25 +397,34 @@ def _require_dates(*days: date | None, max_days: int | None = None) -> None:
|
|
|
397
397
|
|
|
398
398
|
|
|
399
399
|
def _check_record_count(records: GradeRecords, added: int) -> None:
|
|
400
|
+
# The same records `grade_records._Collection.check_size` counts (#195).
|
|
400
401
|
if (
|
|
401
402
|
len(records.numeric)
|
|
402
403
|
+ len(records.descriptive)
|
|
403
404
|
+ len(records.descriptive_summaries)
|
|
404
405
|
+ len(records.formative)
|
|
406
|
+
+ sum(len(item.entries) for item in records.behaviour_points)
|
|
405
407
|
+ added
|
|
406
408
|
> GRADE_MAX_RECORDS
|
|
407
409
|
):
|
|
408
410
|
raise LibrusError(ErrorKind.LIMIT)
|
|
409
411
|
|
|
410
412
|
|
|
413
|
+
def _check_lookups(budget: RequestBudget, lookups: int) -> None:
|
|
414
|
+
"""LIMIT now when `lookups` more requests would exceed the budget."""
|
|
415
|
+
if budget.requests_dispatched + lookups > budget._max_requests:
|
|
416
|
+
raise LibrusError(ErrorKind.LIMIT)
|
|
417
|
+
|
|
418
|
+
|
|
411
419
|
def _cooldown_due(error: LibrusError) -> bool:
|
|
412
420
|
"""A denial, an unrecovered expiry, or a logged-out page that a session
|
|
413
|
-
just signed in also got
|
|
421
|
+
just signed in also got (PARSE, or VIEW_DISABLED for a module that is
|
|
422
|
+
off): signing in again at once cannot help."""
|
|
414
423
|
if error.kind in (ErrorKind.ACCESS_DENIED, ErrorKind.SESSION_EXPIRED):
|
|
415
424
|
return True
|
|
416
425
|
cause = error.__cause__
|
|
417
426
|
return (
|
|
418
|
-
error.kind
|
|
427
|
+
error.kind in (ErrorKind.PARSE, ErrorKind.VIEW_DISABLED)
|
|
419
428
|
and isinstance(cause, SessionExpiredError)
|
|
420
429
|
and cause._logged_out_page
|
|
421
430
|
)
|
|
@@ -1001,7 +1010,13 @@ class AccountClient:
|
|
|
1001
1010
|
raise LibrusError(ErrorKind.UNSUPPORTED_CAPABILITY)
|
|
1002
1011
|
# A bound cookie/account is not proof it is still valid. One fresh
|
|
1003
1012
|
# side-effect-free identity GET prevents avoidable UNKNOWN sends.
|
|
1004
|
-
|
|
1013
|
+
try:
|
|
1014
|
+
await self._modern_ready(budget, refresh=True)
|
|
1015
|
+
except SessionExpiredError as error:
|
|
1016
|
+
# A send never signs in again by itself, whatever ended the
|
|
1017
|
+
# session: the caller decides whether to send again.
|
|
1018
|
+
error._logged_out_page = False
|
|
1019
|
+
raise
|
|
1005
1020
|
|
|
1006
1021
|
def dispatched() -> None:
|
|
1007
1022
|
attempt._dispatch(
|
|
@@ -1434,15 +1449,26 @@ class AccountClient:
|
|
|
1434
1449
|
and are not returned. Only a login whose identity reports the parent
|
|
1435
1450
|
account group (`JUSTIFICATION_ACCOUNT_GROUP`) sends the request; any
|
|
1436
1451
|
other or missing group fails as UNSUPPORTED_CAPABILITY without it,
|
|
1437
|
-
because the page ends a student login's session.
|
|
1452
|
+
because the page ends a student login's session. A parent login that
|
|
1453
|
+
still gets the logged-out page right after signing in fails as
|
|
1454
|
+
VIEW_DISABLED, and its session is cleared.
|
|
1438
1455
|
"""
|
|
1439
1456
|
|
|
1440
|
-
async def fetch(budget: RequestBudget,
|
|
1457
|
+
async def fetch(budget: RequestBudget, fresh_login: bool) -> Justifications:
|
|
1441
1458
|
if self._account_group != JUSTIFICATION_ACCOUNT_GROUP:
|
|
1442
1459
|
raise LibrusError(ErrorKind.UNSUPPORTED_CAPABILITY)
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1460
|
+
try:
|
|
1461
|
+
start, end, items = await self._page(
|
|
1462
|
+
"justifications", budget, parse_justifications
|
|
1463
|
+
)
|
|
1464
|
+
except SessionExpiredError as error:
|
|
1465
|
+
if not (fresh_login and error._logged_out_page):
|
|
1466
|
+
raise
|
|
1467
|
+
# A session just signed in still gets the logged-out page: the
|
|
1468
|
+
# module is off for this login, and the request ended the
|
|
1469
|
+
# session (librus-mcp#136), so the next read signs in again.
|
|
1470
|
+
self._invalidate()
|
|
1471
|
+
raise LibrusError(ErrorKind.VIEW_DISABLED) from error
|
|
1446
1472
|
return Justifications(
|
|
1447
1473
|
self._session_identity(),
|
|
1448
1474
|
start,
|
|
@@ -2573,13 +2599,29 @@ class AccountClient:
|
|
|
2573
2599
|
_check_record_count(records, len(added))
|
|
2574
2600
|
return replace(records, descriptive=records.descriptive + added)
|
|
2575
2601
|
|
|
2602
|
+
def _fresh_metadata(self, endpoint: str, identifier: str) -> str | None:
|
|
2603
|
+
cached = self._metadata.get((endpoint, identifier))
|
|
2604
|
+
if cached and time.monotonic() - cached[0] <= ATTENDANCE_METADATA_TTL_SECONDS:
|
|
2605
|
+
return cached[1]
|
|
2606
|
+
return None
|
|
2607
|
+
|
|
2608
|
+
def _lookups(
|
|
2609
|
+
self, endpoint: str, known: Mapping[str, str], identifiers: Iterable[str]
|
|
2610
|
+
) -> int:
|
|
2611
|
+
"""How many of `identifiers` would cost a per-reference request."""
|
|
2612
|
+
return sum(
|
|
2613
|
+
identifier not in known
|
|
2614
|
+
and self._fresh_metadata(endpoint, identifier) is None
|
|
2615
|
+
for identifier in identifiers
|
|
2616
|
+
)
|
|
2617
|
+
|
|
2576
2618
|
async def _metadata_value(
|
|
2577
2619
|
self, endpoint: str, identifier: str, budget: RequestBudget
|
|
2578
2620
|
) -> str:
|
|
2579
2621
|
key = endpoint, identifier
|
|
2580
|
-
cached = self.
|
|
2581
|
-
if cached
|
|
2582
|
-
return cached
|
|
2622
|
+
cached = self._fresh_metadata(endpoint, identifier)
|
|
2623
|
+
if cached is not None:
|
|
2624
|
+
return cached
|
|
2583
2625
|
parser = (
|
|
2584
2626
|
parse_lesson_subject
|
|
2585
2627
|
if endpoint == "attendance_lesson"
|
|
@@ -2640,14 +2682,15 @@ class AccountClient:
|
|
|
2640
2682
|
if (start is None or r.day >= start) and (end is None or r.day <= end)
|
|
2641
2683
|
)
|
|
2642
2684
|
lessons = dict.fromkeys(row.lesson_id for row in rows)
|
|
2643
|
-
if len(lessons) > ATTENDANCE_METADATA_CACHE_SIZE:
|
|
2644
|
-
raise LibrusError(ErrorKind.LIMIT)
|
|
2645
2685
|
# Two collection reads keep the request count independent of how many
|
|
2646
|
-
# lessons and subjects a student has
|
|
2647
|
-
# collection keep the strict
|
|
2686
|
+
# lessons and subjects a student has; the attendance row cap bounds
|
|
2687
|
+
# both (#199). References absent from a collection keep the strict
|
|
2688
|
+
# per-reference contract, one request each, so fail before spending the
|
|
2689
|
+
# budget on lookups it cannot finish.
|
|
2648
2690
|
lesson_map = (
|
|
2649
2691
|
await self._metadata_map("attendance_lessons", budget) if lessons else {}
|
|
2650
2692
|
)
|
|
2693
|
+
_check_lookups(budget, self._lookups("attendance_lesson", lesson_map, lessons))
|
|
2651
2694
|
lesson_subjects = {
|
|
2652
2695
|
lesson: lesson_map.get(lesson)
|
|
2653
2696
|
or await self._metadata_value("attendance_lesson", lesson, budget)
|
|
@@ -2656,11 +2699,12 @@ class AccountClient:
|
|
|
2656
2699
|
subjects: dict[str, list[GatewayAttendanceRecord]] = {}
|
|
2657
2700
|
for row in rows:
|
|
2658
2701
|
subjects.setdefault(lesson_subjects[row.lesson_id], []).append(row)
|
|
2659
|
-
if len(subjects) > ATTENDANCE_METADATA_CACHE_SIZE:
|
|
2660
|
-
raise LibrusError(ErrorKind.LIMIT)
|
|
2661
2702
|
subject_map = (
|
|
2662
2703
|
await self._metadata_map("attendance_subjects", budget) if subjects else {}
|
|
2663
2704
|
)
|
|
2705
|
+
_check_lookups(
|
|
2706
|
+
budget, self._lookups("attendance_subject", subject_map, subjects)
|
|
2707
|
+
)
|
|
2664
2708
|
items = [
|
|
2665
2709
|
SubjectFrequency(
|
|
2666
2710
|
subject,
|
|
@@ -67,6 +67,7 @@ from librus_python_api.models import (
|
|
|
67
67
|
SendSubmission,
|
|
68
68
|
TransportResponse,
|
|
69
69
|
)
|
|
70
|
+
from librus_python_api.parsers import is_logged_out_page
|
|
70
71
|
from librus_python_api.scheduler import RequestScheduler
|
|
71
72
|
|
|
72
73
|
NUMERIC_REFERENCE = re.compile(r"[0-9]{1,64}")
|
|
@@ -335,6 +336,14 @@ class AiohttpTransport:
|
|
|
335
336
|
budget,
|
|
336
337
|
None,
|
|
337
338
|
)
|
|
339
|
+
if response.status == 200 and is_logged_out_page(response.body):
|
|
340
|
+
# Synergia no longer knows the session, for example after a
|
|
341
|
+
# GET of /eusprawiedliwienia ended it (live 2026-11-23). The
|
|
342
|
+
# launch comes before the operation's own request, so nothing
|
|
343
|
+
# was applied and the read may sign in again once.
|
|
344
|
+
expired = SessionExpiredError(ErrorKind.SESSION_EXPIRED)
|
|
345
|
+
expired._logged_out_page = True
|
|
346
|
+
raise expired
|
|
338
347
|
if response.status != 302:
|
|
339
348
|
raise LibrusError(ErrorKind.UNSUPPORTED_CAPABILITY)
|
|
340
349
|
if self._native_login_redirect(
|
|
@@ -2074,27 +2074,27 @@ wheels = [
|
|
|
2074
2074
|
|
|
2075
2075
|
[[package]]
|
|
2076
2076
|
name = "ruff"
|
|
2077
|
-
version = "0.17.
|
|
2078
|
-
source = { registry = "https://pypi.org/simple" }
|
|
2079
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
|
2080
|
-
wheels = [
|
|
2081
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
2082
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
2083
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
2084
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
2085
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
2086
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
2087
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
2088
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
2089
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
2090
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
2091
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
2092
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
2093
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
2094
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
2095
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
2096
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
2097
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
2077
|
+
version = "0.17.5"
|
|
2078
|
+
source = { registry = "https://pypi.org/simple" }
|
|
2079
|
+
sdist = { url = "https://files.pythonhosted.org/packages/86/cc/7b71512eb8b49926efb887cc66c74dd993642943c29eba51a877f6b85692/ruff-0.17.5.tar.gz", hash = "sha256:625e57d80cd43352d12ea81690f3eac46cddc8c0f35026d137fb0f157f94592e", size = 5368382, upload-time = "2026-11-12T17:54:55.04Z" }
|
|
2080
|
+
wheels = [
|
|
2081
|
+
{ url = "https://files.pythonhosted.org/packages/d4/f2/61df414cb4338617290a9023ad09486e207fb9a6d09357a7be34f2e369a4/ruff-0.17.5-py3-none-linux_armv6l.whl", hash = "sha256:d511dd302982e46a285528942fa6557d57730edc4bdb9def95e86a2603d77396", size = 10231309, upload-time = "2026-11-12T17:54:09.314Z" },
|
|
2082
|
+
{ url = "https://files.pythonhosted.org/packages/d1/72/8ed970f3361f7c8d3f8e1b3b1af27cf086bc4b3a6b62ec20e21a1aaaaff5/ruff-0.17.5-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:b72fbc232e328bdbb9cdddf4f1aedcd61bd1aa64d75fc012114b4add0bd7f26b", size = 10250018, upload-time = "2026-11-12T17:54:11.983Z" },
|
|
2083
|
+
{ url = "https://files.pythonhosted.org/packages/dc/4b/8b10f6c9d0a18413301ae8dd2af9d180a81bb738b1b731d944a37404c523/ruff-0.17.5-py3-none-macosx_11_0_arm64.whl", hash = "sha256:6f0db748508f04a04e3fbebcc636a5c8b3bd76274f8ed28f497c44d75c2ea2d7", size = 9504737, upload-time = "2026-11-12T17:54:14.567Z" },
|
|
2084
|
+
{ url = "https://files.pythonhosted.org/packages/b7/ea/1b3afa3943239dede7a0755ea139bdb51879f0f3f96f92894081d5c7d2e5/ruff-0.17.5-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6f6a7b138edf9cc402ca736a59d9525e6d766e5395760b72e7e146e6251ac963", size = 10168006, upload-time = "2026-11-12T17:54:17.195Z" },
|
|
2085
|
+
{ url = "https://files.pythonhosted.org/packages/31/08/ee641daa45f83792f91274b65796cb011f1065f588911bfa3909ad9e31e7/ruff-0.17.5-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e52622ecf3a0df9d03e796fe3eed4aa085adda65520db7e0619cbd2192a97342", size = 10043751, upload-time = "2026-11-12T17:54:19.815Z" },
|
|
2086
|
+
{ url = "https://files.pythonhosted.org/packages/f8/cf/1c59fdb42d0b5671ad5b160636fab4005ee28db72cb06aef6e3f3c04f377/ruff-0.17.5-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:54c0f67d1be11b55d12c184a819fc229f5eee3ef45c16c4fcad41258e83b4882", size = 10690562, upload-time = "2026-11-12T17:54:22.789Z" },
|
|
2087
|
+
{ url = "https://files.pythonhosted.org/packages/49/c5/578074716173fb0c1591e9648a9f85c469888d9530cb35b89b757dc1208b/ruff-0.17.5-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:dd0dfe7c6fe5a447fce467c58e69893be1d9a7e4378f5b9906432da33d94a97f", size = 11338465, upload-time = "2026-11-12T17:54:25.523Z" },
|
|
2088
|
+
{ url = "https://files.pythonhosted.org/packages/aa/b9/d6428bcf5ed88f4dc1d6e3417ee350236ed36e7a35f9477b727c00e437bf/ruff-0.17.5-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ec4ecf40fb4d6e1265b009dbe551727920926fc0f769070c452d6d84b422a74d", size = 10895501, upload-time = "2026-11-12T17:54:28.441Z" },
|
|
2089
|
+
{ url = "https://files.pythonhosted.org/packages/f2/8a/1e29c0c3785ae7e5cd0d54ee8717a08867ef71545796340be4c653c57e24/ruff-0.17.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:40ca8afaac309b41a5b2e09e4e7beb1f824826b93c25697c4d74f573324fba4e", size = 10613231, upload-time = "2026-11-12T17:54:30.862Z" },
|
|
2090
|
+
{ url = "https://files.pythonhosted.org/packages/32/b6/88944350c14bb90651014d678ad554e233ae2a79c14ad52101845f93d15b/ruff-0.17.5-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:8e85601bd6d9b6c3e3b95c0e0dccdbac1d23c6bcef006d187fbcddaf8225a5df", size = 10562789, upload-time = "2026-11-12T17:54:33.869Z" },
|
|
2091
|
+
{ url = "https://files.pythonhosted.org/packages/6f/fd/2792e955b0bf54295cdcdddc4bb3f380c0790d7e60e789f528a9e6e48a31/ruff-0.17.5-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:f93d2b7d449ed9545304f6923699ca20d13c675b69f258481709a08ae61076db", size = 10069824, upload-time = "2026-11-12T17:54:36.663Z" },
|
|
2092
|
+
{ url = "https://files.pythonhosted.org/packages/07/9c/d7cad341b4c19237948a6dd1fcea1c9c39c9d08b70f22f0e157d1236ebd6/ruff-0.17.5-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:0e5c125c5b31dc8efc948d41357496a4c4a312977565ccba740030efdff83580", size = 10038961, upload-time = "2026-11-12T17:54:39.452Z" },
|
|
2093
|
+
{ url = "https://files.pythonhosted.org/packages/cc/a1/9cd0d4c371ddc70267d3bd557e718e2bdfb94c25e49d25605edfabb764bd/ruff-0.17.5-py3-none-musllinux_1_2_i686.whl", hash = "sha256:50dfc3c6b3ebd0a932f11dfd579bd42234b0b7137e68940eb6abdbfdb9d69697", size = 10385012, upload-time = "2026-11-12T17:54:41.808Z" },
|
|
2094
|
+
{ url = "https://files.pythonhosted.org/packages/8f/a9/35f078ce98d4df318328ea5270382b5b65e680f7953b3db54f8e009c420c/ruff-0.17.5-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:86bd1f3b83c25f9b8055c6e796f0685b39d3127ce947322098c3108cf82fd586", size = 10793672, upload-time = "2026-11-12T17:54:44.342Z" },
|
|
2095
|
+
{ url = "https://files.pythonhosted.org/packages/2c/a5/2e136dede2a88aaaf54498bbbdc81bc810f788ef6ef01efb97037d73cd1d/ruff-0.17.5-py3-none-win32.whl", hash = "sha256:e1546609b2ad73f1d6c5c076881b788672b7b3cc3283981182cbdbb6524ed88a", size = 9929908, upload-time = "2026-11-12T17:54:47.067Z" },
|
|
2096
|
+
{ url = "https://files.pythonhosted.org/packages/ec/8c/e4db9ae1e0ee233c04df007ab6d0d42f799ae9abd95d352b6092ee7bc4bf/ruff-0.17.5-py3-none-win_amd64.whl", hash = "sha256:aa415d57c244299279901d776607fee3df7831c2a7435433fbfacde8632c6550", size = 10275454, upload-time = "2026-11-12T17:54:49.401Z" },
|
|
2097
|
+
{ url = "https://files.pythonhosted.org/packages/e6/65/a1648bc1550e7683bf7bf1e2ce2485c9f8535cbca6cca9ec7b73cc12fb8e/ruff-0.17.5-py3-none-win_arm64.whl", hash = "sha256:64a6fd668a336df959c522991de33e9e3c8be463afc0c9ac8f029f9d19ef756e", size = 9849020, upload-time = "2026-11-12T17:54:52.055Z" },
|
|
2098
2098
|
]
|
|
2099
2099
|
|
|
2100
2100
|
[[package]]
|
|
@@ -2258,11 +2258,11 @@ wheels = [
|
|
|
2258
2258
|
|
|
2259
2259
|
[[package]]
|
|
2260
2260
|
name = "types-pyyaml"
|
|
2261
|
-
version = "6.0.12.
|
|
2261
|
+
version = "6.0.12.20261113"
|
|
2262
2262
|
source = { registry = "https://pypi.org/simple" }
|
|
2263
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
|
2263
|
+
sdist = { url = "https://files.pythonhosted.org/packages/4d/8b/ba599d956693dbc98e170f32097128bdea0a17f9d42b0b490fa749c12b1a/types_pyyaml-6.0.12.20261113.tar.gz", hash = "sha256:0828be2580fd94151182364f4d0158e4de62fdbeeb8d4296f7f7d2b6c22bb640", size = 19017, upload-time = "2026-11-13T08:51:21.488Z" }
|
|
2264
2264
|
wheels = [
|
|
2265
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
2265
|
+
{ url = "https://files.pythonhosted.org/packages/fd/2e/36fc0941a40ef066dbc8abac41bbbefb41389f547c779aef832aea6b873d/types_pyyaml-6.0.12.20261113-py3-none-any.whl", hash = "sha256:3600749e613748afdc4327f0b17c3296cf880cdbc7335f320007abd9dd815f67", size = 21321, upload-time = "2026-11-13T08:51:20.417Z" },
|
|
2266
2266
|
]
|
|
2267
2267
|
|
|
2268
2268
|
[[package]]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/_notification_codec.py
RENAMED
|
File without changes
|
|
File without changes
|
{librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/_windows_filesystem.py
RENAMED
|
File without changes
|
{librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/announcements.py
RENAMED
|
File without changes
|
{librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/attachment_routes.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/class_free_days.py
RENAMED
|
File without changes
|
{librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/detail_fields.py
RENAMED
|
File without changes
|
|
File without changes
|
{librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/formative_grades.py
RENAMED
|
File without changes
|
{librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/gateway_grades.py
RENAMED
|
File without changes
|
{librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/grade_parsers.py
RENAMED
|
File without changes
|
{librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/grade_records.py
RENAMED
|
File without changes
|
{librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/homework_range.py
RENAMED
|
File without changes
|
|
File without changes
|
{librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/justifications.py
RENAMED
|
File without changes
|
|
File without changes
|
{librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/message_content.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/modern_mailbox.py
RENAMED
|
File without changes
|
{librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/modern_messages.py
RENAMED
|
File without changes
|
{librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/notification_models.py
RENAMED
|
File without changes
|
|
File without changes
|
{librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/notification_workflow.py
RENAMED
|
File without changes
|
{librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/notifications.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{librus_python_api-1.11.3 → librus_python_api-1.11.5}/src/librus_python_api/school_year_archive.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|