From c6f4b9194b48b1c5298f05f7cb19132662734c11 Mon Sep 17 00:00:00 2001 From: vgrem Date: Sat, 25 Nov 2023 11:48:00 +0200 Subject: [PATCH] web path introduced --- examples/sharepoint/search/__init__.py | 0 office365/sharepoint/internal/paths/web.py | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+) delete mode 100644 examples/sharepoint/search/__init__.py create mode 100644 office365/sharepoint/internal/paths/web.py diff --git a/examples/sharepoint/search/__init__.py b/examples/sharepoint/search/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/office365/sharepoint/internal/paths/web.py b/office365/sharepoint/internal/paths/web.py new file mode 100644 index 000000000..3e5d61694 --- /dev/null +++ b/office365/sharepoint/internal/paths/web.py @@ -0,0 +1,20 @@ +from office365.runtime.compat import is_absolute_url, urlparse +from office365.runtime.paths.resource_path import ResourcePath + + +class WebPath(ResourcePath): + @property + def segment(self): + return "Web" + + @property + def web_path(self): + if is_absolute_url(self.key): + url_parts = urlparse(self.key) + return url_parts.path + else: + return self.key + + @property + def parent(self): + return None