Lines Matching refs:url
261 _DefragResultBase.url.__doc__ = """The URL with no fragment identifier."""
325 return self.url + '#' + self.fragment
327 return self.url
344 return self.url + b'#' + self.fragment
346 return self.url
372 def urlparse(url, scheme='', allow_fragments=True): argument
392 url, scheme, _coerce_result = _coerce_args(url, scheme)
393 splitresult = urlsplit(url, scheme, allow_fragments)
394 scheme, netloc, url, query, fragment = splitresult
395 if scheme in uses_params and ';' in url:
396 url, params = _splitparams(url)
399 result = ParseResult(scheme, netloc, url, params, query, fragment)
402 def _splitparams(url): argument
403 if '/' in url:
404 i = url.find(';', url.rfind('/'))
406 return url, ''
408 i = url.find(';')
409 return url[:i], url[i+1:]
411 def _splitnetloc(url, start=0): argument
412 delim = len(url) # position of end of domain part of url, default is end
414 wdelim = url.find(c, start) # find first of this delim
417 return url[start:delim], url[delim:] # return (domain, rest)
437 def urlsplit(url, scheme='', allow_fragments=True): argument
458 url, scheme, _coerce_result = _coerce_args(url, scheme)
461 url = url.replace(b, "")
465 key = url, scheme, allow_fragments, type(url), type(scheme)
472 i = url.find(':')
474 for c in url[:i]:
478 scheme, url = url[:i].lower(), url[i+1:]
480 if url[:2] == '//':
481 netloc, url = _splitnetloc(url, 2)
485 if allow_fragments and '#' in url:
486 url, fragment = url.split('#', 1)
487 if '?' in url:
488 url, query = url.split('?', 1)
490 v = SplitResult(scheme, netloc, url, query, fragment)
499 scheme, netloc, url, params, query, fragment, _coerce_result = (
502 url = "%s;%s" % (url, params)
503 return _coerce_result(urlunsplit((scheme, netloc, url, query, fragment)))
511 scheme, netloc, url, query, fragment, _coerce_result = (
513 if netloc or (scheme and scheme in uses_netloc and url[:2] != '//'):
514 if url and url[:1] != '/': url = '/' + url
515 url = '//' + (netloc or '') + url
517 url = scheme + ':' + url
519 url = url + '?' + query
521 url = url + '#' + fragment
522 return _coerce_result(url)
524 def urljoin(base, url, allow_fragments=True): argument
528 return url
529 if not url:
532 base, url, _coerce_result = _coerce_args(base, url)
536 urlparse(url, bscheme, allow_fragments)
539 return _coerce_result(url)
593 def urldefrag(url): argument
600 url, _coerce_result = _coerce_args(url)
601 if '#' in url:
602 s, n, p, a, q, frag = urlparse(url)
606 defrag = url
992 def to_bytes(url): argument
995 return _to_bytes(url)
998 def _to_bytes(url): argument
1003 if isinstance(url, str):
1005 url = url.encode("ASCII").decode()
1007 raise UnicodeError("URL " + repr(url) +
1009 return url
1012 def unwrap(url): argument
1017 url = str(url).strip()
1018 if url[:1] == '<' and url[-1:] == '>':
1019 url = url[1:-1].strip()
1020 if url[:4] == 'URL:':
1021 url = url[4:].strip()
1022 return url
1025 def splittype(url): argument
1029 return _splittype(url)
1033 def _splittype(url): argument
1039 match = _typeprog.match(url)
1043 return None, url
1046 def splithost(url): argument
1050 return _splithost(url)
1054 def _splithost(url): argument
1060 match = _hostprog.match(url)
1066 return None, url
1142 def splitquery(url): argument
1146 return _splitquery(url)
1149 def _splitquery(url): argument
1151 path, delim, query = url.rpartition('?')
1154 return url, None
1157 def splittag(url): argument
1161 return _splittag(url)
1164 def _splittag(url): argument
1166 path, delim, tag = url.rpartition('#')
1169 return url, None
1172 def splitattr(url): argument
1176 return _splitattr(url)
1179 def _splitattr(url): argument
1182 words = url.split(';')