MCPcopy Index your code
hub / github.com/clips/pattern / abs

Function abs

pattern/web/__init__.py:3089–3096  ·  view source on GitHub ↗

Returns the absolute URL: ../media + http://en.wikipedia.org/wiki/ => http://en.wikipedia.org/media

(url, base=None)

Source from the content-addressed store, hash-verified

3087 return urlparse.urlparse(url).netloc
3088
3089def abs(url, base=None):
3090 """ Returns the absolute URL:
3091 ../media + http://en.wikipedia.org/wiki/ => http://en.wikipedia.org/media
3092 """
3093 if url.startswith("#") and not base is None and not base.endswith("/"):
3094 if not re.search("[^/]/[^/]", base):
3095 base += "/"
3096 return urlparse.urljoin(base, url)
3097
3098DEPTH = "depth"
3099BREADTH = "breadth"

Callers 8

12-dom.pyFile · 0.90
crawlMethod · 0.70
begin_pageMethod · 0.50
hdistanceMethod · 0.50
hoverlapMethod · 0.50
vdistanceMethod · 0.50
voverlapMethod · 0.50
__extract_dateFunction · 0.50

Calls 1

searchMethod · 0.45

Tested by

no test coverage detected