Returns the absolute URL: ../media + http://en.wikipedia.org/wiki/ => http://en.wikipedia.org/media
(url, base=None)
| 3087 | return urlparse.urlparse(url).netloc |
| 3088 | |
| 3089 | def 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 | |
| 3098 | DEPTH = "depth" |
| 3099 | BREADTH = "breadth" |
no test coverage detected