/usr/lib/python2.7/site-packages/urllib3/util
NameSizeModeActions
connection.py46390644editdlrm
connection.pyc38380644editdlrm
connection.pyo38380644editdlrm
queue.py4970644editdlrm
queue.pyc13110644editdlrm
queue.pyo13110644editdlrm
request.py37050644editdlrm
request.pyc37090644editdlrm
request.pyo37090644editdlrm
response.py25860644editdlrm
response.pyc23470644editdlrm
response.pyo23470644editdlrm
retry.py151600644editdlrm
retry.pyc145690644editdlrm
retry.pyo145690644editdlrm
ssl_.py132570644editdlrm
ssl_.pyc112870644editdlrm
ssl_.pyo112870644editdlrm
timeout.py97570644editdlrm
timeout.pyc95840644editdlrm
timeout.pyo95840644editdlrm
url.py67990644editdlrm
url.pyc66290644editdlrm
url.pyo66290644editdlrm
wait.py54030644editdlrm
wait.pyc41340644editdlrm
wait.pyo41340644editdlrm
__init__.py10440644editdlrm
__init__.pyc12650644editdlrm
__init__.pyo12650644editdlrm
Edit: /usr/lib/python2.7/site-packages/urllib3/util/url.pyc (6629B)
๓ 9fc@@sบddlmZddlmZddlZddlmZddlmZddd d d d d gZ dZ ej dƒZ dede ƒfd„ƒYZd„Zd„Zd„ZdS(i(tabsolute_import(t namedtupleNi(tLocationParseError(tquotetschemetauththosttporttpathtquerytfragmentthttpthttpss[- ]tUrlcB@sweZdZdZdddddddd„Zed„ƒZed„ƒZed„ƒZ ed„ƒZ d„Z RS( sฬ Datastructure for representing an HTTP URL. Used as a return value for :func:`parse_url`. Both the scheme and host are normalized as they are both case-insensitive according to RFC 3986. c C@s„|r#|jdƒ r#d|}n|r8|jƒ}n|rY|tkrY|jƒ}ntt|ƒj||||||||ƒS(Nt/(t startswithtlowertNORMALIZABLE_SCHEMEStsuperR t__new__(tclsRRRRRR R ((s4/usr/lib/python2.7/site-packages/urllib3/util/url.pyRs !cC@s|jS(s@For backwards-compatibility with urlparse. We're nice like that.(R(tself((s4/usr/lib/python2.7/site-packages/urllib3/util/url.pythostname%scC@s6|jp d}|jdk r2|d|j7}n|S(s)Absolute path including the query string.Rt?N(RR tNone(Rturi((s4/usr/lib/python2.7/site-packages/urllib3/util/url.pyt request_uri*scC@s$|jrd|j|jfS|jS(s(Network location including host and ports%s:%d(RR(R((s4/usr/lib/python2.7/site-packages/urllib3/util/url.pytnetloc4s c C@s๎|\}}}}}}}d}|dk r>||d7}n|dk r[||d7}n|dk rt||7}n|dk r—|dt|ƒ7}n|dk rฐ||7}n|dk rอ|d|7}n|dk r๊|d|7}n|S(sˆ Convert self into a url This function should more or less round-trip with :func:`.parse_url`. The returned url may not be exactly the same as the url inputted to :func:`.parse_url`, but it should be equivalent by the RFC (e.g., urls with a blank port will have : removed). Example: :: >>> U = parse_url('http://google.com/mail/') >>> U.url 'http://google.com/mail/' >>> Url('http', 'username:password', 'host.com', 80, ... '/path', 'query', 'fragment').url 'http://username:password@host.com:80/path?query#fragment' ts://t@t:Rt#N(Rtstr( RRRRRRR R turl((s4/usr/lib/python2.7/site-packages/urllib3/util/url.pyR!;s"         cC@s|jS(N(R!(R((s4/usr/lib/python2.7/site-packages/urllib3/util/url.pyt__str__cs(N( t__name__t __module__t__doc__t __slots__RRtpropertyRRRR!R"(((s4/usr/lib/python2.7/site-packages/urllib3/util/url.pyR s  (cC@sฃd}d}xV|D]N}|j|ƒ}|dkr:qn|dksR||kr|}|}qqW|dks}|dkrŠ|ddfS|| ||d|fS(sา Given a string and an iterable of delimiters, split on the first found delimiter. Return two split parts and the matched delimiter. If not found, then the first part is the full input string. Example:: >>> split_first('foo/bar?baz', '?/=') ('foo', 'bar?baz', '/') >>> split_first('foo/bar?baz', '123') ('foo/bar?baz', '', None) Scales linearly with number of delims. Not ideal for large number of delims. iRiN(Rtfind(tstdelimstmin_idxt min_delimtdtidx((s4/usr/lib/python2.7/site-packages/urllib3/util/url.pyt split_firstgs    c C@s;|s tƒStjd„|ƒ}d }d }d }d }d }d }d }d|krs|jddƒ\}}nt|dddgƒ\}}} | rง| |}nd|krฮ|jddƒ\}}n|r |dd kr |jd dƒ\}}|d 7}nd |kr™|jd dƒ\} }|s<| }n|r|jƒs]t|ƒ‚nyt |ƒ}Wq–t k rŒt|ƒ‚q–Xqฏd }n| rฏ|rฏ|}n|sัt|||||||ƒSd|kr๘|jddƒ\}}nd|kr|jddƒ\}}nt|||||||ƒS( s: Given a url, return a parsed :class:`.Url` namedtuple. Best-effort is performed to parse incomplete urls. Fields not provided will be None. Partly backwards-compatible with :mod:`urlparse`. Example:: >>> parse_url('http://google.com/mail/') Url(scheme='http', host='google.com', port=None, path='/mail/', ...) >>> parse_url('google.com:80') Url(scheme=None, host='google.com', port=80, path=None, ...) >>> parse_url('/foo?bar') Url(scheme=None, host=None, port=None, path='/foo', query='bar', ...) cS@st|jƒƒS(N(Rtgroup(tmatch((s4/usr/lib/python2.7/site-packages/urllib3/util/url.pytคRs://iRRRRit[t]RN( R t!_contains_disallowed_url_pchar_retsubRtsplitR/trsplittisdigitRtintt ValueError( R!RRRRRR R tpath_tdelimt_host((s4/usr/lib/python2.7/site-packages/urllib3/util/url.pyt parse_urlˆsR !            cC@s(t|ƒ}|jpd|j|jfS(s4 Deprecated. Use :func:`parse_url` instead. R (R?RRR(R!tp((s4/usr/lib/python2.7/site-packages/urllib3/util/url.pytget_host้s (R R N(t __future__Rt collectionsRtret exceptionsRtpackages.six.moves.urllib.parseRt url_attrsRRtcompileR5R R/R?RA(((s4/usr/lib/python2.7/site-packages/urllib3/util/url.pyts U ! a