ó b@RTc@syddlmZddlmZdddddd d gZd ed eƒfd „ƒYZd „Zd„Zd„ZdS(iÿÿÿÿ(t namedtuplei(tLocationParseErrortschemetauththosttporttpathtquerytfragmenttUrlcBs_eZdZdZdddddddd„Zed„ƒZed„ƒZed„ƒZ RS(sg Datastructure for representing an HTTP URL. Used as a return value for :func:`parse_url`. c Cs+tt|ƒj||||||||ƒS(N(tsuperR t__new__(tclsRRRRRRR((sO/opt/freeware/lib/python2.7/site-packages/requests/packages/urllib3/util/url.pyR s!cCs|jS(s@For backwards-compatibility with urlparse. We're nice like that.(R(tself((sO/opt/freeware/lib/python2.7/site-packages/requests/packages/urllib3/util/url.pythostnamescCs6|jp d}|jdk r2|d|j7}n|S(s)Absolute path including the query string.t/t?N(RRtNone(R turi((sO/opt/freeware/lib/python2.7/site-packages/requests/packages/urllib3/util/url.pyt request_uriscCs$|jrd|j|jfS|jS(s(Network location including host and ports%s:%d(RR(R ((sO/opt/freeware/lib/python2.7/site-packages/requests/packages/urllib3/util/url.pytnetloc$s (N( t__name__t __module__t__doc__tslotsRR tpropertyRRR(((sO/opt/freeware/lib/python2.7/site-packages/requests/packages/urllib3/util/url.pyR s cCs£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. itiN(Rtfind(tstdelimstmin_idxt min_delimtdtidx((sO/opt/freeware/lib/python2.7/site-packages/requests/packages/urllib3/util/url.pyt split_first,s    c Cs|s tƒSd }d }d }d }d }d }d }d|kr^|jddƒ\}}nt|dddgƒ\}}} | r’| |}nd|kr¹|jddƒ\}}n|rô|ddkrô|jd dƒ\}}|d 7}nd |kr`|jd dƒ\} }|s'| }n|rW|jƒsHt|ƒ‚nt|ƒ}qvd }n| rv|rv|}n|s˜t|||||||ƒSd|kr¿|jddƒ\}}nd|kræ|jddƒ\}}nt|||||||ƒS( s5 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='/', ...) >>> 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', ...) s://iRRt#t@it[t]t:N(R RtsplitR"trsplittisdigitRtint( turlRRRRRRRtpath_tdelimt_host((sO/opt/freeware/lib/python2.7/site-packages/requests/packages/urllib3/util/url.pyt parse_urlMsJ !           cCs(t|ƒ}|jpd|j|jfS(s5 Deprecated. Use :func:`.parse_url` instead. thttp(R0RRR(R,tp((sO/opt/freeware/lib/python2.7/site-packages/requests/packages/urllib3/util/url.pytget_host¦s N( t collectionsRt exceptionsRt url_attrsR R"R0R3(((sO/opt/freeware/lib/python2.7/site-packages/requests/packages/urllib3/util/url.pyts # ! Y