diff options
author | Matthias Baumgartner <dev@igsor.net> | 2023-03-05 19:25:17 +0100 |
---|---|---|
committer | Matthias Baumgartner <dev@igsor.net> | 2023-03-05 19:25:17 +0100 |
commit | e4845c627e97a6d125bf33d9e7a4a8d373d7fc4a (patch) | |
tree | 634198c34aae3c0306ce30ac7452abd7b53a14e8 /bsfs/utils | |
parent | 9b490d19dcebc0fc24cb2ab89a783f1f7d6147f7 (diff) | |
parent | 3ae93a405724ca6b5ddeb0b458fcc95685f83f09 (diff) | |
download | bsfs-e4845c627e97a6d125bf33d9e7a4a8d373d7fc4a.tar.gz bsfs-e4845c627e97a6d125bf33d9e7a4a8d373d7fc4a.tar.bz2 bsfs-e4845c627e97a6d125bf33d9e7a4a8d373d7fc4a.zip |
Merge branch 'mb/diogenes' into develop
Diffstat (limited to 'bsfs/utils')
-rw-r--r-- | bsfs/utils/__init__.py | 5 | ||||
-rw-r--r-- | bsfs/utils/commons.py | 5 | ||||
-rw-r--r-- | bsfs/utils/errors.py | 5 | ||||
-rw-r--r-- | bsfs/utils/uri.py | 13 | ||||
-rw-r--r-- | bsfs/utils/uuid.py | 5 |
5 files changed, 5 insertions, 28 deletions
diff --git a/bsfs/utils/__init__.py b/bsfs/utils/__init__.py index 6737cef..d497645 100644 --- a/bsfs/utils/__init__.py +++ b/bsfs/utils/__init__.py @@ -1,9 +1,4 @@ -""" -Part of the BlackStar filesystem (bsfs) module. -A copy of the license is provided with the project. -Author: Matthias Baumgartner, 2022 -""" # imports import typing diff --git a/bsfs/utils/commons.py b/bsfs/utils/commons.py index e9f0b7f..a7092ae 100644 --- a/bsfs/utils/commons.py +++ b/bsfs/utils/commons.py @@ -1,9 +1,4 @@ -""" -Part of the BlackStar filesystem (bsfs) module. -A copy of the license is provided with the project. -Author: Matthias Baumgartner, 2022 -""" # imports from collections import abc import typing diff --git a/bsfs/utils/errors.py b/bsfs/utils/errors.py index 6ae6484..b82e6e2 100644 --- a/bsfs/utils/errors.py +++ b/bsfs/utils/errors.py @@ -1,9 +1,4 @@ -""" -Part of the BlackStar filesystem (bsfs) module. -A copy of the license is provided with the project. -Author: Matthias Baumgartner, 2022 -""" # imports import typing diff --git a/bsfs/utils/uri.py b/bsfs/utils/uri.py index 84854a4..5755a6e 100644 --- a/bsfs/utils/uri.py +++ b/bsfs/utils/uri.py @@ -1,14 +1,11 @@ -""" -Part of the BlackStar filesystem (bsfs) module. -A copy of the license is provided with the project. -Author: Matthias Baumgartner, 2022 -""" # imports import re import typing # constants +RX_CHARS = re.compile(r'[<>" {}|\\^]') + RX_URI = re.compile(r''' ^ (?:(?P<scheme>[^:/?#]+):)? # scheme, ://-delimited @@ -82,6 +79,9 @@ class URI(str): no claim about the validity of an URI! """ + # check characters + if RX_CHARS.search(query) is not None: + return False # check uri parts = RX_URI.match(query) if parts is not None: @@ -232,9 +232,6 @@ class URI(str): # overload formatting methods - def format(self, *args, **kwargs) -> 'URI': - return URI(super().format(*args, **kwargs)) - def __mod__(self, *args) -> 'URI': return URI(super().__mod__(*args)) diff --git a/bsfs/utils/uuid.py b/bsfs/utils/uuid.py index 70e1656..ad7fc1c 100644 --- a/bsfs/utils/uuid.py +++ b/bsfs/utils/uuid.py @@ -1,9 +1,4 @@ -""" -Part of the BlackStar filesystem (bsfs) module. -A copy of the license is provided with the project. -Author: Matthias Baumgartner, 2022 -""" # imports from collections import abc import hashlib |