Skip to content

Commit

Permalink
Merge branch 'main' into feat/task-processing
Browse files Browse the repository at this point in the history
  • Loading branch information
bigcat88 authored Jul 5, 2024
2 parents 4268d96 + 818dc2e commit 399427b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

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

## [0.14.0 - 2024-05-31]
## [0.14.0 - 2024-07-0X]

### Added

- `LoginFlowV2` implementation by @blvdek #255
- NextcloudApp: `nc.ui.files_dropdown_menu.register_ex` to register new version of FileActions(AppAPI 2.6.0+) #252
- `files.get_tags` function to get all tags assigned to the file or directory. #260
- NextcloudApp: `nc.ui.files_dropdown_menu.register_ex` to register new version of FileActions(AppAPI 2.6.0+) #252
- NextcloudApp: `enabled_state` property to check if current ExApp is disabled or enabled.

## [0.13.0 - 2024-04-28]

Expand Down
15 changes: 15 additions & 0 deletions nc_py_api/nextcloud.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Nextcloud class providing access to all API endpoints."""

import contextlib
import typing
from abc import ABC

Expand Down Expand Up @@ -333,6 +334,13 @@ def __init__(self, **kwargs):
self.events_listener = EventsListenerAPI(self._session)
self.occ_commands = OccCommandsAPI(self._session)

@property
def enabled_state(self) -> bool:
"""Returns ``True`` if ExApp is enabled, ``False`` otherwise."""
with contextlib.suppress(Exception):
return bool(self._session.ocs("GET", "/ocs/v1.php/apps/app_api/ex-app/state"))
return False

def log(self, log_lvl: LogLvl, content: str) -> None:
"""Writes log to the Nextcloud log file."""
if self.check_capabilities("app_api"):
Expand Down Expand Up @@ -456,6 +464,13 @@ def __init__(self, **kwargs):
self.events_listener = AsyncEventsListenerAPI(self._session)
self.occ_commands = AsyncOccCommandsAPI(self._session)

@property
async def enabled_state(self) -> bool:
"""Returns ``True`` if ExApp is enabled, ``False`` otherwise."""
with contextlib.suppress(Exception):
return bool(await self._session.ocs("GET", "/ocs/v1.php/apps/app_api/ex-app/state"))
return False

async def log(self, log_lvl: LogLvl, content: str) -> None:
"""Writes log to the Nextcloud log file."""
if await self.check_capabilities("app_api"):
Expand Down

0 comments on commit 399427b

Please sign in to comment.