From c361f6eefda083d5a7eacd5cae064569f9b81950 Mon Sep 17 00:00:00 2001 From: Piotr Slupski Date: Tue, 28 Jan 2025 17:13:07 +0100 Subject: [PATCH 1/3] Add quickshare --- filecloudapi/fcserver.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/filecloudapi/fcserver.py b/filecloudapi/fcserver.py index 4141454..f591151 100644 --- a/filecloudapi/fcserver.py +++ b/filecloudapi/fcserver.py @@ -902,6 +902,34 @@ def share(self, path: str, adminproxyuserid: str = "") -> FCShare: str_to_bool(resp.findtext("./share/allowpublicuploadonly", "")), ) + def quickshare(self, sharelocation: str, adminproxyuserid: str = "") -> FCShare: + """ + Quick Share 'sharelocation' + """ + resp = self._api_call( + "/core/quickshare", + {"sharelocation": sharelocation, "adminproxyuserid": adminproxyuserid}, + ) + + shareid = resp.findtext("./share/shareid", "") + + if not shareid: + msg = resp.findtext("./meta/message", "") + if msg: + raise ServerError("", msg) + else: + raise ServerError("", "No shareid in response") + + return FCShare( + shareid, + resp.findtext("./share/sharename", ""), + resp.findtext("./share/sharelocation", ""), + str_to_bool(resp.findtext("./share/allowpublicaccess", "")), + str_to_bool(resp.findtext("./share/allowpublicupload", "")), + str_to_bool(resp.findtext("./share/allowpublicviewonly", "")), + str_to_bool(resp.findtext("./share/allowpublicuploadonly", "")), + ) + def getshareforpath(self, path: str, adminproxyuserid: str = "") -> FCShare: """ Share 'path' From 40cbfed58619d86611ce978e9e9582097e80741d Mon Sep 17 00:00:00 2001 From: Piotr Slupski Date: Tue, 28 Jan 2025 17:36:38 +0100 Subject: [PATCH 2/3] Bump version to 0.2.1 --- pyproject.toml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index dda49a4..4e51292 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [tool.poetry] name = "filecloudapi-python" -version = "0.2" +version = "0.2.1" description = "A Python library to connect to a Filecloud server" packages = [{ include = "filecloudapi" }] @@ -14,8 +14,7 @@ homepage = "https://pypi.org/project/filecloudapi-python" documentation = "https://filecloudapi-python.readthedocs.io" repository = "https://github.com/codelathe/filecloudapi-python" -keywords = [ -] +keywords = [] classifiers = [ "Development Status :: 4 - Beta", "Natural Language :: English", @@ -23,7 +22,7 @@ classifiers = [ "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.11", - "License :: OSI Approved :: Apache Software License" + "License :: OSI Approved :: Apache Software License", ] [tool.poetry.dependencies] @@ -37,7 +36,7 @@ requests = "*" # Formatters black = "^22.1" -tomli = "*" # missing 'black' dependency +tomli = "*" # missing 'black' dependency isort = "^5.10" # Linters @@ -45,7 +44,7 @@ mypy = "^1.0" pydocstyle = "^6.1" pylint = "~2.15" pylint-pytest = "*" -wrapt = "*" # missing 'pylint' dependency +wrapt = "*" # missing 'pylint' dependency # Testing pytest = "^8.1" From 11e7f78de21d2b5f1917d9e8909c375376e55516 Mon Sep 17 00:00:00 2001 From: Piotr Slupski Date: Tue, 28 Jan 2025 17:46:24 +0100 Subject: [PATCH 3/3] Clean whitespace --- pyproject.toml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 4e51292..a4e729f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,8 @@ homepage = "https://pypi.org/project/filecloudapi-python" documentation = "https://filecloudapi-python.readthedocs.io" repository = "https://github.com/codelathe/filecloudapi-python" -keywords = [] +keywords = [ +] classifiers = [ "Development Status :: 4 - Beta", "Natural Language :: English", @@ -22,7 +23,7 @@ classifiers = [ "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.11", - "License :: OSI Approved :: Apache Software License", + "License :: OSI Approved :: Apache Software License" ] [tool.poetry.dependencies] @@ -36,7 +37,7 @@ requests = "*" # Formatters black = "^22.1" -tomli = "*" # missing 'black' dependency +tomli = "*" # missing 'black' dependency isort = "^5.10" # Linters @@ -44,7 +45,7 @@ mypy = "^1.0" pydocstyle = "^6.1" pylint = "~2.15" pylint-pytest = "*" -wrapt = "*" # missing 'pylint' dependency +wrapt = "*" # missing 'pylint' dependency # Testing pytest = "^8.1"