Skip to content
This repository has been archived by the owner on Sep 25, 2024. It is now read-only.

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
SecondThundeR committed May 15, 2022
2 parents def0af8 + 6caacd5 commit d414231
Show file tree
Hide file tree
Showing 7 changed files with 180 additions and 169 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ repos:
exclude: doc/data/messages/(r/reimported|w/wrong-import-order|u/ungrouped-imports|m/misplaced-future)/bad.py
types: [python]
- id: pylint
name: Checking docs with pylint
name: Checking code with pylint
language: python
entry: pylint
args: ["-rn", "-sn", "--rcfile=.pylintrc", "--load-plugins=pylint.extensions.docparams"]
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "shikithon"
version = "0.1.2"
version = "0.2.0"
description = "Yet another Python wrapper for Shikimori API"
authors = [
"SecondThundeR <[email protected]>"
Expand Down
2 changes: 1 addition & 1 deletion shikithon/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Contains package version and some magic for importing API object."""
from shikithon.api import API

__version__ = '0.1.2'
__version__ = '0.2.0'
__all__ = ['API']
322 changes: 161 additions & 161 deletions shikithon/api.py

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions shikithon/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,12 +609,12 @@ def dialogs(self) -> str:
"""
return f'{self.base_url}/dialogs'

def dialog(self, dialog_id: int) -> str:
def dialog(self, dialog_id: Union[int, str]) -> str:
"""
Returns endpoint of a certain comment.
Returns endpoint of a certain dialog with user.
:param dialog_id: Dialog ID for endpoint
:type dialog_id: int
:param dialog_id: User ID/Nickname for endpoint
:type dialog_id: Union[int, str]
:return: Dialog endpoint link
:rtype: str
Expand Down
11 changes: 11 additions & 0 deletions shikithon/models/dialog.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"""Model for api/dialogs"""
from pydantic import BaseModel

from shikithon.models.message import Message
from shikithon.models.user import User


class Dialog(BaseModel):
"""Represents dialog entity."""
target_user: User
message: Message
2 changes: 1 addition & 1 deletion shikithon/models/message.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Model for /api/messages"""
"""Model for /api/messages and submodel for dialog.py"""
from datetime import datetime
from typing import Optional

Expand Down

0 comments on commit d414231

Please sign in to comment.