From f5e48810e724206ce47794a9451288461da914de Mon Sep 17 00:00:00 2001 From: Antoni-Czaplicki <56671347+Antoni-Czaplicki@users.noreply.github.com> Date: Tue, 12 Mar 2024 10:05:33 +0100 Subject: [PATCH 1/2] Add message_box field to Student class --- vulcan/__init__.py | 2 +- vulcan/_api.py | 4 +--- vulcan/_data.py | 3 +-- vulcan/data/__init__.py | 1 - vulcan/model/__init__.py | 1 + vulcan/{data => model}/_messagebox.py | 2 +- vulcan/model/_student.py | 3 +++ 7 files changed, 8 insertions(+), 8 deletions(-) rename vulcan/{data => model}/_messagebox.py (95%) diff --git a/vulcan/__init__.py b/vulcan/__init__.py index ed64ebb..b322fd9 100644 --- a/vulcan/__init__.py +++ b/vulcan/__init__.py @@ -13,7 +13,7 @@ ) from ._keystore import Keystore -__version__ = "2.3.2" +__version__ = "2.3.3" __doc__ = "Unofficial API for UONET+ e-register" __all__ = [ diff --git a/vulcan/_api.py b/vulcan/_api.py index 41c98f7..1fd29ca 100644 --- a/vulcan/_api.py +++ b/vulcan/_api.py @@ -103,9 +103,7 @@ async def _request( full_url = ( url if url.startswith("http") - else self._rest_url + url - if self._rest_url - else None + else self._rest_url + url if self._rest_url else None ) if not full_url: diff --git a/vulcan/_data.py b/vulcan/_data.py index 5ddf98c..fb8b404 100644 --- a/vulcan/_data.py +++ b/vulcan/_data.py @@ -13,9 +13,8 @@ Lesson, LuckyNumber, Message, - MessageBox, ) -from .model import DateTime +from .model import DateTime, MessageBox class VulcanData: diff --git a/vulcan/data/__init__.py b/vulcan/data/__init__.py index 368abf6..b9c1325 100644 --- a/vulcan/data/__init__.py +++ b/vulcan/data/__init__.py @@ -8,4 +8,3 @@ from ._lesson import ChangedLesson, Lesson, LessonChanges, LessonRoom from ._lucky_number import LuckyNumber from ._message import Address, Message -from ._messagebox import MessageBox diff --git a/vulcan/model/__init__.py b/vulcan/model/__init__.py index 8120ff8..43b4702 100644 --- a/vulcan/model/__init__.py +++ b/vulcan/model/__init__.py @@ -2,6 +2,7 @@ from ._attachment import Attachment from ._datetime import DateTime +from ._messagebox import MessageBox from ._period import Period from ._pupil import Gender, Pupil from ._school import School diff --git a/vulcan/data/_messagebox.py b/vulcan/model/_messagebox.py similarity index 95% rename from vulcan/data/_messagebox.py rename to vulcan/model/_messagebox.py index d0dd788..3f71fb4 100644 --- a/vulcan/data/_messagebox.py +++ b/vulcan/model/_messagebox.py @@ -4,7 +4,7 @@ from related import IntegerField, StringField, immutable from .._endpoints import DATA_MESSAGEBOX -from ..model import Serializable +from ._serializable import Serializable @immutable diff --git a/vulcan/model/_student.py b/vulcan/model/_student.py index 72a19b1..870b7bb 100644 --- a/vulcan/model/_student.py +++ b/vulcan/model/_student.py @@ -4,6 +4,7 @@ from related import ChildField, SequenceField, StringField, immutable from .._endpoints import STUDENT_LIST +from ._messagebox import MessageBox from ._period import Period from ._pupil import Pupil from ._school import School @@ -24,6 +25,7 @@ class Student(Serializable): (e.g. several school buildings) :var `~vulcan.model.School` ~.school: info about the school (a single building of the unit) + :var `~vulcan.model.MessageBox` ~.message_box: the student's message box :var List[`~vulcan.model.Period`] ~.periods: a list of the student's school year periods """ @@ -35,6 +37,7 @@ class Student(Serializable): pupil: Pupil = ChildField(Pupil, key="Pupil") unit: Unit = ChildField(Unit, key="Unit") school: School = ChildField(School, key="ConstituentUnit") + message_box: MessageBox = ChildField(MessageBox, key="MessageBox") periods: List[Period] = SequenceField(Period, key="Periods") @property From 0ad5da5b8b64927c1e6c347a8d5c335f40e6ee49 Mon Sep 17 00:00:00 2001 From: Antoni Czaplicki <56671347+Antoni-Czaplicki@users.noreply.github.com> Date: Tue, 12 Mar 2024 22:37:01 +0100 Subject: [PATCH 2/2] Undo version change --- vulcan/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vulcan/__init__.py b/vulcan/__init__.py index b322fd9..ed64ebb 100644 --- a/vulcan/__init__.py +++ b/vulcan/__init__.py @@ -13,7 +13,7 @@ ) from ._keystore import Keystore -__version__ = "2.3.3" +__version__ = "2.3.2" __doc__ = "Unofficial API for UONET+ e-register" __all__ = [