aboutsummaryrefslogtreecommitdiff
path: root/src/ee
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2019-05-28 11:04:13 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2019-05-28 11:04:13 +0200
commit57305c50931fee63833b4d6813f2af521362033f (patch)
tree64b6a7279c875b80657c72c853e0601339f84235 /src/ee
parentdb6a0c66db74dc04b1adcc9b09fda3e1e81e3fcd (diff)
downloadee-python-57305c50931fee63833b4d6813f2af521362033f.tar.gz
ee-python-57305c50931fee63833b4d6813f2af521362033f.tar.bz2
ee-python-57305c50931fee63833b4d6813f2af521362033f.tar.xz
ee-python-57305c50931fee63833b4d6813f2af521362033f.zip
adding missing method.
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):