aboutsummaryrefslogtreecommitdiff
path: root/src/ee
diff options
context:
space:
mode:
Diffstat (limited to 'src/ee')
-rw-r--r--src/ee/digikey/__init__.py7
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):