diff options
Diffstat (limited to 'src/ee/digikey/__init__.py')
-rw-r--r-- | src/ee/digikey/__init__.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ee/digikey/__init__.py b/src/ee/digikey/__init__.py index 031faff..4c4adce 100644 --- a/src/ee/digikey/__init__.py +++ b/src/ee/digikey/__init__.py @@ -496,6 +496,13 @@ class DigikeyParser(object): else: return DigikeySearchResponse(1, SearchResponseTypes.NO_MATCHES) + @staticmethod + def ensure_absolute_url(origin_url, url): + if not url.startswith("http"): + o = urllib.parse.urlparse(origin_url) + url = "{}://{}{}".format(o.scheme, o.netloc, url) + return url + class DigikeyRepository(object): def __init__(self, digikey, path): |