Skip to content

Commit 26ee0a8

Browse files
authored
reworked FileAPI (#51)
Signed-off-by: Alexander Piskun <[email protected]>
1 parent db4c453 commit 26ee0a8

File tree

9 files changed

+435
-254
lines changed

9 files changed

+435
-254
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,15 @@ All notable changes to this project will be documented in this file.
77
### Added
88

99
- More documentation.
10-
- First `Notifications` APIs.
1110

1211
### Changed
1312

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

1720
## [0.0.25 - 2023-07-25]
1821

docs/Options.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,4 @@ Options
88
.. autodata:: nc_py_api.options.XDEBUG_SESSION
99
.. autodata:: nc_py_api.options.TIMEOUT
1010
.. autodata:: nc_py_api.options.TIMEOUT_DAV
11-
.. autodata:: nc_py_api.options.DAV_URL_SUFFIX
1211
.. autodata:: nc_py_api.options.VERIFY_NC_CERTIFICATE

docs/reference/Files.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ Refer to the **fs examples** to see how to use them nicely.
88

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

11+
.. autoclass:: FsNodeInfo
12+
:members:
13+
1114
.. autoclass:: FsNode
1215
:members:
1316

nc_py_api/_session.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ def __init__(self, **kwargs):
4949
self.endpoint = full_nc_url.removesuffix("/index.php").removesuffix("/")
5050
self.dav_url_suffix = self._get_value("dav_url_suffix", raise_not_found=False, **kwargs)
5151
if not self.dav_url_suffix:
52-
self.dav_url_suffix = options.DAV_URL_SUFFIX
52+
self.dav_url_suffix = "remote.php/dav"
53+
self.dav_url_suffix = "/" + self.dav_url_suffix.strip("/")
5354
self.dav_endpoint = self.endpoint + self.dav_url_suffix
5455

5556
@staticmethod

0 commit comments

Comments
 (0)