HEX
Server: LiteSpeed
System: Linux us-phx-web1284.main-hosting.eu 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: u300739242 (300739242)
PHP: 8.2.30
Disabled: system, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Upload Files
File: //opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/clsregistry.pyc
�
���ec@s|dZddlZddlmZddlmZddlmZddlmZddl	m
Z
d	d
lmZd	dlmZd	dlm	Z	d	d
l
mZe�Zd�Zd�Zd�Zdefd��YZdefd��YZdefd��YZdefd��YZeje�d��defd��YZd�Zdefd��YZdad�ZdS( s�Routines to handle the string class registry used by declarative.

This system allows specification of classes and expressions used in
:func:`_orm.relationship` using strings.

i����Ni(t
attributes(t
interfaces(tSynonymProperty(tColumnProperty(tclass_mapperi(texc(t
inspection(tutil(t_get_table_keycCs�||krE||}t|t�sOt||g�}||<qOn
|||<y|d}Wn(tk
r�tdd�|d<}nX|jjd�}xX|r�|jd�}|j|�}x|D]}|j|�}q�W|j	||�q�WdS(s^Add a class to the _decl_class_registry associated with the
    given declarative class.

    t_sa_module_registryt.iN(
t
isinstancet_MultipleClassMarkertKeyErrort
_ModuleMarkertNonet
__module__tsplittpopt
get_modulet	add_class(t	classnametclstdecl_class_registrytexistingtroot_modulettokensttokentmodule((sK/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/clsregistry.pyR s"



	
cCs�||kr?||}t|t�r5|j|�q?||=ny|d}Wntk
radSX|jjd�}xX|r�|jd�}|j|�}x|D]}|j|�}q�W|j||�qwWdS(NR	R
i(	RRtremove_itemR
RRRRtremove_class(RRRRRRRR((sK/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/clsregistry.pyRHs 


	
cCs_||krtS||}t|t�rPx/|jD]}||�r3tSq3Wn||�SdS(s�test if a key is empty of a certain object.

    used for unit tests against the registry to see if garbage collection
    is working.

    "test" is a callable that will be passed an object should return True
    if the given object is the one we were looking for.

    We can't pass the actual object itself b.c. this is for testing garbage
    collection; the caller will have to have removed references to the
    object itself.

    N(tTrueRRtcontentstFalse(tkeyRttesttthingt	sub_thing((sK/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/clsregistry.pyt
_key_is_empty_s
RcBsMeZdZd
Zdd�Zd�Zd�Zd�Zd�Z	d	�Z
RS(sRrefers to multiple classes of the same name
    within _decl_class_registry.

    t	on_removeR t__weakref__cCsK||_tg|D]}tj||j�^q�|_tj|�dS(N(R'tsettweakreftreft_remove_itemR t_registriestadd(tselftclassesR'titem((sK/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/clsregistry.pyt__init__�s	.cCs|jtj|��dS(N(R,R*R+(R/R((sK/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/clsregistry.pyR�scCsd�|jD�S(Ncss|]}|�VqdS(N((t.0R+((sK/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/clsregistry.pys	<genexpr>�s(R (R/((sK/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/clsregistry.pyt__iter__�scCszt|j�dkr;tjddj||g���n;t|j�d}|�}|dkrrt|��n|SdS(NisxMultiple classes found for path "%s" in the registry of this declarative base. Please use a fully module-qualified path.R
i(tlenR RtInvalidRequestErrortjointlistRt	NameError(R/tpathR"R+R((sK/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/clsregistry.pytattempt_get�s	cCsC|jj|�|js?tj|�|jr?|j�q?ndS(N(R tdiscardR-R'(R/R+((sK/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/clsregistry.pyR,�s
	
	cCs�tggt|j�D]}|�^qD]}|dk	r)|j^q)�}|j|kr|tjd|j|jf�n|jjt	j
||j��dS(Ns�This declarative base already contains a class with the same class name and module name as %s.%s, and will be replaced in the string-lookup table.(R)R8R RRRtwarnt__name__R.R*R+R,(R/R1R+Rtmodules((sK/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/clsregistry.pytadd_item�s)(R'R R(N(R>Rt__doc__t	__slots__RR2RR4R;R,R@(((sK/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/clsregistry.pyRys				RcBs\eZdZdZd�Zd�Zd	�Zd
�Zd�Zd�Z	d
�Z
d�ZRS(s>Refers to a module name within
    _decl_class_registry.

    tparenttnameR tmod_nsR:R(cCsi||_||_i|_t|�|_|jrO|jj|jg|_n	g|_tj|�dS(N(RCRDR t_ModNSRER:R-R.(R/RDRC((sK/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/clsregistry.pyR2�s					cCs
||jkS(N(R (R/RD((sK/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/clsregistry.pyt__contains__�scCs|j|S(N(R (R/RD((sK/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/clsregistry.pyt__getitem__�scCsS|jj|d�|jrO|jdk	rO|jj|j�tj|�ndS(N(R RRRCR,RDR-R<(R/RD((sK/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/clsregistry.pyR,�scCst|j|�S(N(tgetattrRE(R/R"((sK/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/clsregistry.pytresolve_attr�scCs?||jkr.t||�}||j|<n
|j|}|S(N(R R(R/RDtmarker((sK/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/clsregistry.pyR�s

cs\��jkr,�j�}|j|�n,t|gd��fd��}�j�<dS(NR'cs
�j��S(N(R,((RDR/(sK/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/clsregistry.pyt<lambda>�t(R R@R(R/RDRR((RDR/sK/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/clsregistry.pyR�s

cCs0||jkr,|j|}|j|�ndS(N(R R(R/RDRR((sK/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/clsregistry.pyR�s
(RCRDR RER:R((R>RRARBR2RGRHR,RJRRR(((sK/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/clsregistry.pyR�s								RFcBs eZdZd�Zd�ZRS(t__parentcCs
||_dS(N(t_ModNS__parent(R/RC((sK/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/clsregistry.pyR2�scCs�y|jj|}Wntk
r'nQX|dk	rxt|t�rJ|jSt|t�s_t�|j	|jj
|�Sntd|jj|f��dS(Ns<Module %r has no mapped classes registered under the name %r(
ROR R
RRRRERtAssertionErrorR;R:R9RD(R/R"tvalue((sK/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/clsregistry.pyt__getattr__�s
(RN(R>RRBR2RR(((sK/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/clsregistry.pyRF�s	t_GetColumnscBs eZdZd�Zd�ZRS(RcCs
||_dS(N(R(R/R((sK/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/clsregistry.pyR2
scCs�t|jdt�}|r�||jkrFtd|j|f��n|j|}|jtjkr�|j}t	|t
�r�|j}q�t	|t�s�t
jd|��q�q�nt|j|�S(Nt	configures/Class %r does not have a mapped column named %rsaProperty %r is not an instance of ColumnProperty (i.e. does not correspond directly to a Column).(RRR!tall_orm_descriptorstAttributeErrortextension_typeRt
NOT_EXTENSIONtpropertyRRRDRRR6RI(R/R"tmptdesctprop((sK/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/clsregistry.pyRRs 
	(R(R>RRBR2RR(((sK/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/clsregistry.pyRS
s	cCstj|j�S(N(RtinspectR(ttarget((sK/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/clsregistry.pyRL(RMt	_GetTablecBs eZdZd�Zd�ZRS(R"tmetadatacCs||_||_dS(N(R"R`(R/R"R`((sK/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/clsregistry.pyR2/s	cCs|jjt||j�S(N(R`ttablesRR"(R/R"((sK/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/clsregistry.pyRR3s(R"R`(R>RRBR2RR(((sK/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/clsregistry.pyR_,s	cCs.t|t�r$|jg|�}nt|�S(N(RRR;RS(R"RQ((sK/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/clsregistry.pyt_determine_container7st_class_resolvercBs>eZdZed�Zd�Zd	�Zd
�Zd�ZRS(
RR\targtfallbackt_dictt
_resolverstfavor_tablescCsO||_||_||_||_tj|j�|_d|_||_	dS(N((
RR\RdReRtPopulateDictt_access_clsRfRgRh(R/RR\ReRdRh((sK/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/clsregistry.pyR2Hs					c
CsT|j}tj|�}|j}|j}|j}|jrx||jkrV|j|S||jkrxt	||j�Sn||kr�t
|||�S|js�||jkr�|j|S||jkr�t	||j�Snd|kr
||dkr
|d}|j|�S|jrIx0|jD]"}||�}	|	dk	r |	Sq Wn|j|S(NR	(RRtmanager_of_classtregistryt_class_registryR`RhRat_schemasR_RbRJRgRRe(
R/R"Rtmanagert	decl_baseRR`RltresolvRQ((sK/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/clsregistry.pyRjQs6						

	cCs<tjtjd|jj|j||jf�d|�dS(Ns�When initializing mapper %s, expression %r failed to locate a name (%r). If this is a class name, consider adding this relationship() to the %r class after both dependent classes have been defined.tfrom_(Rtraise_RR6R\RCRdR(R/RDterr((sK/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/clsregistry.pyt_raise_for_namevs
"cCs�|j}|j}d}yFx?|jd�D].}|dkrJ||}q+t||�}q+WWnLtk
r�}|j||�nDtk
r�}|j|jd|�nXt	|t
�r�|jS|SdS(NR
i(RdRfRRRIR
RuR9targsRRSR(R/RDtdtrvalRRttn((sK/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/clsregistry.pyt
_resolve_name�s		
cCsjy9t|jt�|j�}t|t�r4|jS|SWn*tk
re}|j|j	d|�nXdS(Ni(
tevalRdtglobalsRfRRSRR9RuRv(R/txRy((sK/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/clsregistry.pyt__call__�s(RR\RdReRfRgRh(	R>RRBR!R2RjRuRzR~(((sK/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/clsregistry.pyRc=s		%		cs�tdkrZddl}ddlm}m}tj|j�j	i|d6|d6�ant
��fd�}��fd�}||fS(Ni����(tforeigntremoteRR�cst��t|d|�S(NRh(Rct_fallback_dict(RdRh(RR\(sK/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/clsregistry.pytresolve_arg�scst��t|�jS(N(RcR�Rz(Rd(RR\(sK/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/clsregistry.pytresolve_name�s(R�Rt
sqlalchemytsqlalchemy.ormRR�Rt
immutabledictt__dict__tunionR!(RR\R�RR�R�R�((RR\sK/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/clsregistry.pyt	_resolver�s( RAR*RMRRtdescriptor_propsRt
propertiesRRRRRt
sql.schemaRR)R-RRR&tobjectRRRFRSt	_inspectsR_RbRcRR�R�(((sK/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/clsregistry.pyt<module>s2		(		@9
	e