Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
ó
ȍEYc@sŒdZddlmZddlmZddlmZddlmZddlmZddlm	Z	d	ed	ej
ƒfd
„ƒYZdS(s?Module containing the implementation of the URIReference class.iÿÿÿÿ(t
namedtuplei(tcompat(t
exceptions(tmisc(tnormalizers(t
validatorstURIReferencecBs
eZdZdZdd„Zd„Zedd„ƒZd„Ze	d„ƒZ
e	d„ƒZe	d„ƒZd	„Z
d
„Zed„Zed„Zed
„Zed„Zed„Zd„Zd„Zed„Zd„Zejejejejejd„ZRS(sÝImmutable object representing a parsed URI Reference.

    .. note::

        This class is not intended to be directly instantiated by the user.

    This object exposes attributes for the following components of a
    URI:

    - scheme
    - authority
    - path
    - query
    - fragment

    .. attribute:: scheme

        The scheme that was parsed for the URI Reference. For example,
        ``http``, ``https``, ``smtp``, ``imap``, etc.

    .. attribute:: authority

        Component of the URI that contains the user information, host,
        and port sub-components. For example,
        ``google.com``, ``127.0.0.1:5000``, ``username@[::1]``,
        ``username:password@example.com:443``, etc.

    .. attribute:: path

        The path that was parsed for the given URI Reference. For example,
        ``/``, ``/index.php``, etc.

    .. attribute:: query

        The query component for a given URI Reference. For example, ``a=b``,
        ``a=b%20c``, ``a=b+c``, ``a=b,c=d,e=%20f``, etc.

    .. attribute:: fragment

        The fragment component of a URI. For example, ``section-3.1``.

    This class also provides extra attributes for easier access to information
    like the subcomponents of the authority component.

    .. attribute:: userinfo

        The user information parsed from the authority.

    .. attribute:: host

        The hostname, IPv4, or IPv6 adddres parsed from the authority.

    .. attribute:: port

        The port parsed from the authority.
    sutf-8c
CsFtt|ƒj||pd|p$d|p-d||ƒ}||_|S(sCreate a new URIReference.N(tsuperRt__new__tNonetencoding(tclstschemet	authoritytpathtquerytfragmentR
tref((s@/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/uri.pyRVs					cCs¦|}t|tƒr$t|Œ}nWt|tƒs{ytj|ƒ}Wq{tk
rwtdjt|ƒjƒƒ‚q{Xnt|ƒt|ƒk}|p¥|j|ƒS(s"Compare this reference to another.s)Unable to compare URIReference() to {0}()(	t
isinstancettupleRtfrom_stringt	TypeErrortformatttypet__name__tnormalized_equality(tselftothert	other_reftnaive_equality((s@/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/uri.pyt__eq__cs
cCs{tj||ƒ}tjj|ƒjƒ}||d|dtj|d|ƒtj|d|ƒtj|d|ƒ|ƒS(s	Parse a URI reference from the given unicode URI string.

        :param str uri_string: Unicode URI to be parsed into a reference.
        :param str encoding: The encoding of the string provided
        :returns: :class:`URIReference` or subclass thereof
        RR
RRR(Rtto_strRtURI_MATCHERtmatcht	groupdictRtencode_component(Rt
uri_stringR
t	split_uri((s@/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/uri.pyRtscCsÌ|js"idd6dd6dd6Stjj|jƒ}|dkrdtj|jj|jƒƒ‚n|j	ƒ}|j
dƒ}|rÈtjj|ƒrÈtj
|ƒrÈtj|jj|jƒƒ‚n|S(sÌReturn a dictionary with the ``userinfo``, ``host``, and ``port``.

        If the authority is not valid, it will raise a
        :class:`~rfc3986.exceptions.InvalidAuthority` Exception.

        :returns:
            ``{'userinfo': 'username:password', 'host': 'www.example.com',
            'port': '80'}``
        :rtype: dict
        :raises rfc3986.exceptions.InvalidAuthority:
            If the authority is not ``None`` and can not be parsed.
        tuserinfothosttportN(R
R	RtSUBAUTHORITY_MATCHERR!texctInvalidAuthoritytencodeR
R"tgettIPv4_MATCHERRtvalid_ipv4_host_address(RR!tmatchesR'((s@/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/uri.pytauthority_info‡s
	!!cCs0y|jƒ}Wntjk
r'dSX|dS(s+If present, a string representing the host.R'N(R1R*R+R	(RR
((s@/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/uri.pyR'­s
cCs0y|jƒ}Wntjk
r'dSX|dS(s2If present, the port extracted from the authority.R(N(R1R*R+R	(RR
((s@/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/uri.pyR(¶s
cCs0y|jƒ}Wntjk
r'dSX|dS(s6If present, the userinfo extracted from the authority.R&N(R1R*R+R	(RR
((s@/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/uri.pyR&¿s
cCsttjj|jƒƒƒS(séDetermine if this URI Reference is an absolute URI.

        See http://tools.ietf.org/html/rfc3986#section-4.3 for explanation.

        :returns: ``True`` if it is an absolute URI, ``False`` otherwise.
        :rtype: bool
        (tboolRtABSOLUTE_URI_MATCHERR!tunsplit(R((s@/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/uri.pytis_absoluteÈscKs’|j|jdtƒf|j|jdtƒf|j|jdtƒf|j|jdtƒf|j|jdtƒfg}td„|DƒƒS(s÷Determine if the URI is valid.

        :param bool require_scheme: Set to ``True`` if you wish to require the
            presence of the scheme component.
        :param bool require_authority: Set to ``True`` if you wish to require
            the presence of the authority component.
        :param bool require_path: Set to ``True`` if you wish to require the
            presence of the path component.
        :param bool require_query: Set to ``True`` if you wish to require the
            presence of the query component.
        :param bool require_fragment: Set to ``True`` if you wish to require
            the presence of the fragment component.
        :returns: ``True`` if the URI is valid. ``False`` otherwise.
        :rtype: bool
        trequire_schemetrequire_authoritytrequire_patht
require_querytrequire_fragmentcss!|]\}}||ƒVqdS(N((t.0tvtr((s@/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/uri.pys	<genexpr>és(tscheme_is_validR-tFalsetauthority_is_validt
path_is_validtquery_is_validtfragment_is_validtall(RtkwargsR((s@/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/uri.pytis_validÒscCsEy|jƒWntjk
r%tSXtj|jd|jd|ƒS(sDetermine if the authority component is valid.

        :param bool require:
            Set to ``True`` to require the presence of this component.
        :returns:
            ``True`` if the authority is valid. ``False`` otherwise.
        :rtype:
            bool
        R'trequire(R1R*R+R?RR@R
R'(RRG((s@/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/uri.pyR@ës
		cCstj|j|ƒS(sõDetermine if the scheme component is valid.

        :param str require: Set to ``True`` to require the presence of this
            component.
        :returns: ``True`` if the scheme is valid. ``False`` otherwise.
        :rtype: bool
        (RR>R(RRG((s@/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/uri.pyR>scCstj|j|ƒS(sñDetermine if the path component is valid.

        :param str require: Set to ``True`` to require the presence of this
            component.
        :returns: ``True`` if the path is valid. ``False`` otherwise.
        :rtype: bool
        (RRAR(RRG((s@/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/uri.pyRA
scCstj|j|ƒS(sóDetermine if the query component is valid.

        :param str require: Set to ``True`` to require the presence of this
            component.
        :returns: ``True`` if the query is valid. ``False`` otherwise.
        :rtype: bool
        (RRBR(RRG((s@/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/uri.pyRBscCstj|j|ƒS(sùDetermine if the fragment component is valid.

        :param str require: Set to ``True`` to require the presence of this
            component.
        :returns: ``True`` if the fragment is valid. ``False`` otherwise.
        :rtype: bool
        (RRCR(RRG((s@/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/uri.pyRCsc	Cssttj|jpdƒtj|j|j|jfƒtj|j	pHdƒtj
|jƒtj|j
ƒ|jƒS(sNormalize this reference as described in Section 6.2.2.

        This is not an in-place normalization. Instead this creates a new
        URIReference.

        :returns: A new reference object with normalized components.
        :rtype: URIReference
        t(RRtnormalize_schemeRtnormalize_authorityR&R'R(tnormalize_pathRtnormalize_queryRtnormalize_fragmentRR
(R((s@/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/uri.pyt	normalize(scCs"t|jƒƒt|jƒƒkS(sCompare this URIReference to another URIReference.

        :param URIReference other_ref: (required), The reference with which
            we're comparing.
        :returns: ``True`` if the references are equal, ``False`` otherwise.
        :rtype: bool
        (RRN(RR((s@/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/uri.pyR;sc
CsÁt|tƒs!tj|ƒ}n|jƒs?tj|ƒ‚n|jƒ}|}|r|j|jkr|jddƒ}n|jdk	r¯|jdt
j|jƒƒ}n|j
dk	rè|jd|jdt
j|jƒƒ}nÕ|jdkrK|jdk	r|j}n	|j}|jd|jd|j
d|jd|ƒ}nr|jjdƒrrt
j|jƒ}nt
jtj||jƒƒ}|jd|jd|j
d|d|jƒ}|S(s¢Use an absolute URI Reference to resolve this relative reference.

        Assuming this is a relative reference that you would like to resolve,
        use the provided base URI to resolve it.

        See http://tools.ietf.org/html/rfc3986#section-5 for more information.

        :param base_uri: Either a string or URIReference. It must be an
            absolute URI or it will raise an exception.
        :returns: A new URIReference which is the result of resolving this
            reference using ``base_uri``.
        :rtype: :class:`URIReference`
        :raises rfc3986.exceptions.ResolutionError:
            If the ``base_uri`` is not an absolute URI.
        RRR
Rt/N(RRRR5R*tResolutionErrorRNRt	copy_withR	RRKRR
Rt
startswithRtmerge_paths(Rtbase_uritstrictt	resolvingttargetRR((s@/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/uri.pytresolve_withEsD											cCsÃg}|jr(|j|jdgƒn|jrJ|jd|jgƒn|jrf|j|jƒn|jdk	rŽ|jd|jgƒn|jdk	r¶|jd|jgƒndj|ƒS(s…Create a URI string from the components.

        :returns: The URI Reference reconstituted as a string.
        :rtype: str
        t:s//t?t#RHN(	RtextendR
RtappendRR	Rtjoin(Rtresult_list((s@/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/uri.pyR4‹s			c
Cs„i|d6|d6|d6|d6|d6}x9t|jƒƒD]%\}}|tjkr<||=q<q<W|j|}	|j|	_|	S(sCreate a copy of this reference with the new components.

        :param str scheme:
            (optional) The scheme to use for the new reference.
        :param str authority:
            (optional) The authority to use for the new reference.
        :param str path:
            (optional) The path to use for the new reference.
        :param str query:
            (optional) The query to use for the new reference.
        :param str fragment:
            (optional) The fragment to use for the new reference.
        :returns:
            New URIReference with provided components.
        :rtype:
            URIReference
        RR
RRR(tlisttitemsRtUseExistingt_replaceR
(
RRR
RRRt
attributestkeytvalueturi((s@/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/uri.pyRQŸs
((Rt
__module__t__doc__tslotsRRtclassmethodRR1tpropertyR'R(R&R5RFR?R@R>RARBRCRNRRXR4RRbRQ(((s@/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/uri.pyRs08		&				
	



		
F	N(RitcollectionsRRHRRR*RRRtURI_COMPONENTSR(((s@/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/uri.pyt<module>s