Ñò ‰„[Jc@sdZddklZddkZddklZddkZddddd d d d d ddg Zdefd„ƒYZ de fd„ƒYZ de fd„ƒYZ de fd„ƒYZ d e fd„ƒYZd„Zd„Zd„Zd„Zd„Zd„Zd„ZdS(s6Visitor/traversal interface and library functions. SQLAlchemy schema and expression constructs rely on a Python-centric version of the classic "visitor" pattern as the primary way in which they apply functionality. The most common use of this pattern is statement compilation, where individual expression classes match up to rendering methods that produce a string result. Beyond this, the visitor system is also used to inspect expressions for various information and patterns, as well as for usage in some kinds of expression transformation. Other kinds of transformation use a non-visitor traversal system. For many examples of how the visit system is used, see the sqlalchemy.sql.util and the sqlalchemy.sql.compiler modules. For an introduction to clause adaption, see http://techspot.zzzeek.org/?p=19 . iÿÿÿÿ(tdequeN(tutilt VisitableTypet Visitablet ClauseVisitortCloningVisitortReplacingCloningVisitortiteratetiterate_depthfirstttraverse_usingttraversetcloned_traversetreplacement_traversecBseZdZd„ZRS(syMetaclass which checks for a `__visit_name__` attribute and applies `_compiler_dispatch` method to classes. cs¼|idjo!tt|ƒi|||ƒdSt|dƒp td‚|i}t|tƒo&t i d|ƒ‰‡fd†}n d„}||_ tt|ƒi|||ƒdS(NRt__visit_name__s6`Visitable` descendants should define `__visit_name__`svisit_%scsˆ|ƒ||S(N((tselftvisitortkw(tgetter(s;/usr/lib/python2.6/site-packages/sqlalchemy/sql/visitors.pyt_compiler_dispatch1sc[st|d|iƒ||S(Nsvisit_%s(tgetattrR (RRR((s;/usr/lib/python2.6/site-packages/sqlalchemy/sql/visitors.pyR4s( t__name__tsuperRt__init__thasattrtAssertionErrorR t isinstancetstrtoperatort attrgetterR(tclstclsnametbasestclsdictt visit_nameR((Rs;/usr/lib/python2.6/site-packages/sqlalchemy/sql/visitors.pyR$s   (Rt __module__t__doc__R(((s;/usr/lib/python2.6/site-packages/sqlalchemy/sql/visitors.pyRscBseZdZeZRS(sXBase class for visitable objects, applies the ``VisitableType`` metaclass. (RR"R#Rt __metaclass__(((s;/usr/lib/python2.6/site-packages/sqlalchemy/sql/visitors.pyR;scBsYeZdZhZd„Zd„Zd„Zeid„ƒZ e d„ƒZ d„Z RS(s_Base class for visitor objects which can traverse using the traverse() function. cCsCx<|iD]1}t|d|idƒ}|o ||ƒSq WdS(Nsvisit_%s(t_visitor_iteratorRR tNone(Rtobjtvtmeth((s;/usr/lib/python2.6/site-packages/sqlalchemy/sql/visitors.pyttraverse_singleKs  cCst||iƒS(sOtraverse the given expression structure, returning an iterator of all elements.(Rt__traverse_options__(RR'((s;/usr/lib/python2.6/site-packages/sqlalchemy/sql/visitors.pyRQscCst||i|iƒS(s2traverse and visit the given expression structure.(R R+t _visitor_dict(RR'((s;/usr/lib/python2.6/site-packages/sqlalchemy/sql/visitors.pyR VscCsLh}x?t|ƒD]1}|idƒot||ƒ||ds(      4