%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/self/root/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/
Upload File :
Create Path :
Current File : //proc/self/root/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/annotation.pyc

�
��4]c@sydZddlmZddlmZdefd��YZiZdd�Zdd�Z	d	�Z
d
�Zd�ZdS(
s�The :class:`.Annotated` class and related routines; creates hash-equivalent
copies of SQL constructs which contain context-specific markers and
associations.

i(t	operatorsi(tutilt	AnnotatedcBs}eZdZd�Zd�Zd�Zd�Zded�Z	d�Z
ed��Zd�Z
d	�Zd
�Zd�ZRS(
sEclones a ClauseElement and applies an 'annotations' dictionary.

    Unlike regular clones, this clone also mimics __hash__() and
    __cmp__() of the original element so that it takes its place
    in hashed collections.

    A reference to the original element is maintained, for the important
    reason of keeping its hash value current.  When GC'ed, the
    hash value may be reused, causing conflicts.

    .. note::  The rationale for Annotated producing a brand new class,
       rather than placing the functionality directly within ClauseElement,
       is **performance**.  The __hash__() method is absent on plain
       ClauseElement which leads to significantly reduced function call
       overhead, as the use of sets and dictionaries against ClauseElement
       objects is prevalent, but most are not "annotated".

    cGsg|stj|�S|\}}yt|j}Wn#tk
rUt|j|�}nXtj|�SdS(N(tobjectt__new__tannotated_classest	__class__tKeyErrort_new_annotation_type(tclstargstelementtvalues((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/annotation.pyR&s

cCs7|jj�|_||_||_t|�|_dS(N(t__dict__tcopyt_Annotated__elementt_annotationsthasht_hash(tselfRR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/annotation.pyt__init__4s		cCs)|jj�}|j|�|j|�S(N(RRtupdatet_with_annotations(RRt_values((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/annotation.pyt	_annotate:s
cCs4|jj|j�}|jj�|_||_|S(N(RRR
RR(RRtclone((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/annotation.pyR?s	cCsT|dkr|jS|jj�}x|D]}|j|d�q)W|j|�SdS(N(tNoneRRRtpopR(RRRRtv((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/annotation.pyt_deannotateEs
cKs|jjj|||�S(N(RRt_compiler_dispatch(Rtvisitortkw((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/annotation.pyRNscCs
|jjS(N(Rt_constructor(R((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/annotation.pyR!QscCsL|jj�}||jkr"|S|jj|j�|j||j�SdS(N(Rt_cloneR
RRR(RR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/annotation.pyR"Us
cCs|j|j|jffS(N(RRR(R((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/annotation.pyt
__reduce__`scCs|jS(N(R(R((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/annotation.pyt__hash__cscCsEt|jtj�r+|jjj||�St|�t|�kSdS(N(t
isinstanceRRtColumnOperatorsRt__eq__R(Rtother((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/annotation.pyR'fsN(t__name__t
__module__t__doc__RRRRRtTrueRRtpropertyR!R"R#R$R'(((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/annotation.pyRs									cs4���fd��|dk	r0�|�}n|S(s�Deep copy the given ClauseElement, annotating each element
    with the given annotations dictionary.

    Elements within the exclude collection will be cloned but not annotated.

    csq�r6t|d�r6|jj��r6|j�}n'�|jkrW|j��}n|}|jd��|S(Nt	proxy_setR(thasattrR.tintersectionR"RRt_copy_internals(telemtnewelem(tannotationsRtexclude(sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/annotation.pyR{sN(R(RR4R5((R4RR5sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/annotation.pyt_deep_annotatesscs@tj�����fd��|dk	r<�|�}n|S(s2Deep copy the given element, removing annotations.cs]�s|�krQ|jd�dt�}|jd���sM|�|<n|S�|SdS(NRR(RR,R1(R2R3(RtclonedR(sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/annotation.pyR�s
N(Rtcolumn_dictR(RR((RR7RsL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/annotation.pyt_deep_deannotate�s
cCs|j|�}|j�|S(sAnnotate the given ClauseElement and copy its internals so that
    internal objects refer to the new annotated object.

    Basically used to apply a "dont traverse" annotation to a
    selectable, without digging throughout the whole
    structure wasting time.
    (RR1(RR4((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/annotation.pyt_shallow_annotate�s
cCs�t|t�r|S|tkr't|Sx+|jD] }|tkr1t|}Pq1q1Wtd|j||fi�t|<}|t�d|j<|S(NsAnnotated%s(t
issubclassRRt__mro__ttypeR)tglobals(R	tbase_clstsuper_tanno_cls((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/annotation.pyR�s
$cCsF|g}x6|rA|j�}|j|j��t||�qWdS(N(Rtextendt__subclasses__R(ttarget_hierarchyR?tstackR	((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/annotation.pyt_prepare_annotations�s
		N(
R+tRRRRRRR6R9R:RRF(((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/annotation.pyt<module>s^	
	

Zerion Mini Shell 1.0