Skip to content

Commit 5744d58

Browse files
committed
Add method to get unquoted fragment
The fragment can be encoded but some users need the unquoted form.
1 parent 9a822c6 commit 5744d58

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

python/lsst/resources/_resourcePath.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -393,9 +393,14 @@ def is_root(self) -> bool:
393393

394394
@property
395395
def fragment(self) -> str:
396-
"""Return the fragment component of the URI."""
396+
"""Return the fragment component of the URI. May be quoted."""
397397
return self._uri.fragment
398398

399+
@property
400+
def unquoted_fragment(self) -> str:
401+
"""Return unquoted fragment."""
402+
return urllib.parse.unquote(self.fragment)
403+
399404
@property
400405
def params(self) -> str:
401406
"""Return any parameters included in the URI."""

0 commit comments

Comments
 (0)