Skip to content

Commit

Permalink
web path introduced
Browse files Browse the repository at this point in the history
  • Loading branch information
vgrem committed Nov 25, 2023
1 parent c552771 commit c6f4b91
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Empty file.
20 changes: 20 additions & 0 deletions office365/sharepoint/internal/paths/web.py
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit c6f4b91

Please sign in to comment.