From c1127c869c8aa95b52d7b8c6b86ed2cf59ac0b59 Mon Sep 17 00:00:00 2001 From: igorlanov Date: Sat, 29 May 2021 19:28:06 +0400 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B4=D0=B5=D1=81=D0=B5=D1=80=D0=B8?= =?UTF-8?q?=D0=B0=D0=BB=D0=B8=D0=B7=D0=B0=D1=86=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Поле `mark` в некоторых дневниках может отсутствовать. Не быть `null`, а именно отсутствовать. Ужас... --- .bumpversion.cfg | 12 ------------ README.md | 2 +- docs/reference.md | 1 - mkdocs.yml | 2 +- netschoolapi/__init__.py | 1 - netschoolapi/netschoolapi.py | 2 +- netschoolapi/schemas.py | 3 +-- setup.py | 2 +- 8 files changed, 5 insertions(+), 20 deletions(-) delete mode 100644 .bumpversion.cfg diff --git a/.bumpversion.cfg b/.bumpversion.cfg deleted file mode 100644 index ead875e..0000000 --- a/.bumpversion.cfg +++ /dev/null @@ -1,12 +0,0 @@ -[bumpversion] -commit = True -tag = True -current_version = 5.0.0 -parse = (?P\d+)\.(?P\d+)\.(?P\d+)(\-(?P[a-z]+))? -message = Обновление версии с {current_version} на {new_version} -serialize = - {major}.{minor}.{patch}-{release} - {major}.{minor}.{patch} - -[bumpversion:file:setup.py] -[bumpversion:file:netschoolapi/client.py] diff --git a/README.md b/README.md index e923482..7b8e942 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ NetSchoolAPI — это асинхронный клиент для «Сетевого города», который может получить дневник с домашними заданиями и оценками, объявления и просроченные задания. -> Библиотека не имеет отношения к «ИрТеху». +> Библиотека не имеет отношения к «ИрТеху» **Установка, пример проекта, описание методов и датаклассов описано в [документации](https://netschoolapi.readthedocs.io/) проекта.** diff --git a/docs/reference.md b/docs/reference.md index 43ceede..cda0582 100644 --- a/docs/reference.md +++ b/docs/reference.md @@ -125,7 +125,6 @@ datetime.date(2021, 4, 21) * `post_date: date` --- дата, когда объявление было загружено на сайт * `attachments: list[Attachment]` --- приложения к объявлению - ## Attachment {#attachment} Приложенные файлы к урокам и объявлениям. diff --git a/mkdocs.yml b/mkdocs.yml index b9f88ea..79bdbd2 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -22,4 +22,4 @@ nav: theme: readthedocs extra: - version: 5.0.1 + version: 5.0.2 diff --git a/netschoolapi/__init__.py b/netschoolapi/__init__.py index aded282..ae4c2e5 100644 --- a/netschoolapi/__init__.py +++ b/netschoolapi/__init__.py @@ -2,4 +2,3 @@ __all__ = ['NetSchoolAPI'] -__version__ = '5.0.0' diff --git a/netschoolapi/netschoolapi.py b/netschoolapi/netschoolapi.py index cc3ae67..e91dd4d 100644 --- a/netschoolapi/netschoolapi.py +++ b/netschoolapi/netschoolapi.py @@ -19,7 +19,7 @@ def __init__(self, url: str): url = url.rstrip('/') self._client = AsyncClient( base_url='{0}/webapi'.format(url), - headers={'user-agent': 'NetSchoolAPI/5.0.1', 'referer': url}, + headers={'user-agent': 'NetSchoolAPI/5.0.2', 'referer': url}, event_hooks={'response': [_die_on_bad_status]}, ) diff --git a/netschoolapi/schemas.py b/netschoolapi/schemas.py index 45cc4d6..13ce06d 100644 --- a/netschoolapi/schemas.py +++ b/netschoolapi/schemas.py @@ -43,7 +43,7 @@ class Assignment(NetSchoolAPISchema): @pre_load def unwrap_marks(self, assignment: dict[str, Any], **_) -> dict[str, str]: - mark = assignment.pop('mark') + mark = assignment.pop('mark', None) if mark: assignment.update(mark) else: @@ -51,7 +51,6 @@ def unwrap_marks(self, assignment: dict[str, Any], **_) -> dict[str, str]: return assignment - class Lesson(NetSchoolAPISchema): day = fields.Date() start = fields.Time(data_key='startTime') diff --git a/setup.py b/setup.py index f1be009..949202e 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setup( name='netschoolapi', - version='5.0.1', + version='5.0.2', description='Асинхронный API-клиент для «Сетевого города»', long_description=long_description, long_description_content_type='text/markdown',