Skip to content

Commit

Permalink
reworked FileAPI (#51)
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
  • Loading branch information
bigcat88 authored Jul 29, 2023
1 parent db4c453 commit 26ee0a8
Show file tree
Hide file tree
Showing 9 changed files with 435 additions and 254 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@ All notable changes to this project will be documented in this file.
### Added

- More documentation.
- First `Notifications` APIs.

### Changed

- Reworked `User Status API`, `Users Group API`
- Reworked return type for `weather_status.get_location`
- Reworked `Files API`: `mkdir`, `upload`, `copy`, `move` return new `FsNode` object
- Reworked `listdir`: added `depth` parameter
- Reworked `FsNode`: changed `info` from `TypedDict` to `dataclass`, correct fields names with correct descriptions.
- `FsNode` now allows comparison for equality.

## [0.0.25 - 2023-07-25]

Expand Down
1 change: 0 additions & 1 deletion docs/Options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ Options
.. autodata:: nc_py_api.options.XDEBUG_SESSION
.. autodata:: nc_py_api.options.TIMEOUT
.. autodata:: nc_py_api.options.TIMEOUT_DAV
.. autodata:: nc_py_api.options.DAV_URL_SUFFIX
.. autodata:: nc_py_api.options.VERIFY_NC_CERTIFICATE
3 changes: 3 additions & 0 deletions docs/reference/Files.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ Refer to the **fs examples** to see how to use them nicely.

All File APIs are designed to work relative to the current user.

.. autoclass:: FsNodeInfo
:members:

.. autoclass:: FsNode
:members:

Expand Down
3 changes: 2 additions & 1 deletion nc_py_api/_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ def __init__(self, **kwargs):
self.endpoint = full_nc_url.removesuffix("/index.php").removesuffix("/")
self.dav_url_suffix = self._get_value("dav_url_suffix", raise_not_found=False, **kwargs)
if not self.dav_url_suffix:
self.dav_url_suffix = options.DAV_URL_SUFFIX
self.dav_url_suffix = "remote.php/dav"
self.dav_url_suffix = "/" + self.dav_url_suffix.strip("/")
self.dav_endpoint = self.endpoint + self.dav_url_suffix

@staticmethod
Expand Down
Loading

0 comments on commit 26ee0a8

Please sign in to comment.