Skip to content

Commit

Permalink
fixed docs CI
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Piskun <[email protected]>
  • Loading branch information
bigcat88 committed Aug 11, 2024
2 parents ad33b1a + ce6ece1 commit b93cc82
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 23 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

All notable changes to this project will be documented in this file.

## [0.16.0 - 2024-08-xx]
## [0.16.0 - 2024-08-12]

### Changed

- NextcloudApp: rework of TaskProcessing provider API. #284

### Fixed

Expand Down
15 changes: 15 additions & 0 deletions docs/reference/ExApp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,21 @@ UI methods should be accessed with the help of :class:`~nc_py_api.nextcloud.Next
.. autoclass:: nc_py_api.ex_app.providers.translations._TranslationsProviderAPI
:members:

.. autoclass:: nc_py_api.ex_app.providers.task_processing.ShapeType
:members:

.. autoclass:: nc_py_api.ex_app.providers.task_processing.ShapeEnumValue
:members:

.. autoclass:: nc_py_api.ex_app.providers.task_processing.ShapeDescriptor
:members:

.. autoclass:: nc_py_api.ex_app.providers.task_processing.TaskType
:members:

.. autoclass:: nc_py_api.ex_app.providers.task_processing.TaskProcessingProvider
:members:

.. autoclass:: nc_py_api.ex_app.providers.task_processing._TaskProcessingProviderAPI
:members:

Expand Down
27 changes: 6 additions & 21 deletions nc_py_api/ex_app/providers/task_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ class ShapeType(IntEnum):
VIDEO = 4
FILE = 5
ENUM = 6
LISTOFNUMBERS = 10
LISTOFTEXTS = 11
LISTOFIMAGES = 12
LISTOFAUDIOS = 13
LISTOFVIDEOS = 14
LISTOFFILES = 15
LIST_OF_NUMBERS = 10
LIST_OF_TEXTS = 11
LIST_OF_IMAGES = 12
LIST_OF_AUDIOS = 13
LIST_OF_VIDEOS = 14
LIST_OF_FILES = 15


@dataclass
Expand Down Expand Up @@ -73,9 +73,6 @@ class TaskType:

@dataclass
class TaskProcessingProvider:
"""TaskProcessing provider description."""

# pylint: disable=too-many-instance-attributes

id: str
"""Unique ID for the provider."""
Expand Down Expand Up @@ -114,18 +111,12 @@ def __init__(self, session: NcSessionApp):

def register(
self,
name: str,
display_name: str,
task_type: str,
provider: TaskProcessingProvider,
custom_task_type: TaskType | None = None,
) -> None:
"""Registers or edit the TaskProcessing provider."""
require_capabilities("app_api", self._session.capabilities)
params = {
"name": name,
"displayName": display_name,
"taskType": task_type,
"provider": RootModel(provider).model_dump(),
**({"customTaskType": RootModel(custom_task_type).model_dump()} if custom_task_type else {}),
}
Expand Down Expand Up @@ -198,18 +189,12 @@ def __init__(self, session: AsyncNcSessionApp):

async def register(
self,
name: str,
display_name: str,
task_type: str,
provider: TaskProcessingProvider,
custom_task_type: TaskType | None = None,
) -> None:
"""Registers or edit the TaskProcessing provider."""
require_capabilities("app_api", await self._session.capabilities)
params = {
"name": name,
"displayName": display_name,
"taskType": task_type,
"provider": RootModel(provider).model_dump(),
**({"customTaskType": RootModel(custom_task_type).model_dump()} if custom_task_type else {}),
}
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ lint.select = [
"W",
]
lint.extend-ignore = [
"D101",
"D105",
"D107",
"D203",
Expand Down Expand Up @@ -173,7 +174,6 @@ master.py-version = "3.10"
master.extension-pkg-allow-list = [
"pydantic",
]
design.max-attributes = 8
design.max-locals = 20
design.max-branches = 16
design.max-returns = 8
Expand Down Expand Up @@ -206,6 +206,7 @@ messages_control.disable = [
"line-too-long",
"too-few-public-methods",
"too-many-public-methods",
"too-many-instance-attributes",
]

[tool.pytest.ini_options]
Expand Down

0 comments on commit b93cc82

Please sign in to comment.