Ñò ò²WOc&@sñddkZddkZddkZddkZddkZddkZddkZedƒZddk l Z yddk Z Wne j oddk Z nXeedeƒp eid^jZeo eZn©eid_joddkZeeifZnzd deddfZyeiideƒWnej oddkZnXddkZeiieƒeeifZeƒZeoddkZn3yddk ZWne j oddkZnXd „Z!eed e!ƒZ!eid`jod e"fd„ƒYZ#nd e"fd„ƒYZ#eo d„Z$n ei$Z$eoddk%l&Z&n ei&Z&yddk'l(Z(Wn)e j ode"fd„ƒYZ(nXdd„Z)d„Z*d„Z+yddk%l,Z,Wn"e j odadbd„Z,nXyddk%l-Z-Wnd„Z-nXdd „Z.d!„Z/d"„Z0eidcjo d#„Z1n d$„Z1d%„Z2d&„Z3d'„Z4e5d(„Z6e5d)„Z7d*„Z8d+„Z9d,„Z:d-„Z;d.„Z<e5d/„Z=dd0„Z>d1„Z?d2„Z@d3aAd4„ZBd5„ZCddd6dd7„ZDd8eEfd9„ƒYZFd:e"fd;„ƒYZGd<efd=„ƒYZHd>eEfd?„ƒYZId@eIfdA„ƒYZJdB„ZKeZLe"ZMeHZNe#ZOedC„ZPdDeEfdE„ƒYZQdFeEfdG„ƒYZRdHeRfdI„ƒYZSdJeEfdK„ƒYZTdLeT_UdLeEfdM„ƒYZVddddN„ZWdO„ZXdPeEfdQ„ƒYZYdReEfdS„ƒYZZdT„Z[dUei\fdV„ƒYZ]dW„Z^dX„Z_dY„Z`de5dZ„Zade5d[„Zbdd\„Zcd]„ZddS(diÿÿÿÿNttypes(texct py3kwarningiiiitignorecCs|S(N((tx((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pytbuffer2sRit PopulateDictcBs eZdZd„Zd„ZRS(s¡A dict which populates missing values via a creation function. Note the creation function takes a key, unlike collections.defaultdict. cCs ||_dS(N(tcreator(tselfR((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyt__init__@scCs|i|ƒ||<}|S(N(R(Rtkeytval((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyt __missing__Cs(t__name__t __module__t__doc__R R (((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyR8s cBs eZdZd„Zd„ZRS(s>A dict which populates missing values via a creation function.cCs ||_dS(N(R(RR((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyR JscCsFyti||ƒSWn+tj o|i|ƒ||<}|SXdS(N(tdictt __getitem__tKeyErrorR(RR tvalue((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyRMs (R RRR R(((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyRGs cCs t|dƒS(Nt__call__(thasattr(tfn((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pytcallableUs(treduce(t defaultdictRcBsSeZdd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z RS( cOsN|dj o!t|dƒ otdƒ‚nti|||Ž||_dS(NRsfirst argument must be callable(tNoneRt TypeErrorRR tdefault_factory(RRtatkw((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyR cs  cCs8yti||ƒSWntj o|i|ƒSXdS(N(RRRR (RR ((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyRiscCs8|idjot|ƒ‚n|iƒ||<}|S(N(RRR(RR R((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyR nscCsH|idjo tƒ}n |if}t|ƒ|dd|iƒfS(N(RRttuplettypet iteritems(Rtargs((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyt __reduce__ss  cCs |iƒS(N(t__copy__(R((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pytcopyyscCst|ƒ|i|ƒS(N(R R(R((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyR${scCs1ddk}t|ƒ|i|i|iƒƒƒS(Niÿÿÿÿ(R%R Rtdeepcopytitems(RtmemoR%((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyt __deepcopy__}s cCsd|iti|ƒfS(Nsdefaultdict(%s, %s)(RRt__repr__(R((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyR*s N( R RRR RR R#R%R$R)R*(((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyRbs       cCs8|djo|St|ttfƒp|gS|SdS(N(Rt isinstancetlistR(Rtdefault((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pytto_list†s  cCs>|djotƒSt|tƒptt|ƒƒS|SdS(N(RtsetR+R.(R((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pytto_setŽs  cCs>|djotƒSt|tƒptt|ƒƒS|SdS(N(Rt column_setR+R.(R((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyt to_column_set–s  (tupdate_wrapperRRR t__dict__cCsax'|D]}t||t||ƒƒqWx0|D](}t||ƒit||dƒƒq1W|S(N((tsetattrtgetattrtupdate(twrappertwrappedtassignedtupdatedtattr((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyR3¢s&(tpartialcs‡‡‡fd†}|S(Ncs*ˆiƒ}|i|ƒˆˆ||ŽS(N(R%R7(tfargst fkeywordst newkeywords(R"tfunctkeywords(s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pytnewfunc¯s  ((RAR"RBRC((RBR"RAs3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyR=®scs‡fd†}|S(NcsXtiˆƒ‰ˆdp td‚‡‡‡fd†‰‡fd†}t|ƒˆƒS(Nis(Decorated function does not accept *argscsrˆogˆdjo ti}n ti}dˆitiˆŒˆdˆdf}ti||ddƒndS(Ntpendings¡%s%s now accepts multiple %s arguments as a variable argument list. Supplying %s as a single list is deprecated and support will be removed in a future release.it stackleveli(RtSAPendingDeprecationWarningtSADeprecationWarningt func_nametinspectt formatargspectwarningstwarn(t warning_typetmsg(tlist_deprecationtspecR(s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyt _deprecate¼s    csOt|dtƒo*ˆƒ|t|dd!ƒ|d|ŽS|||ŽSdS(Niÿÿÿÿi(R+R,(RR"R(RQ(s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pytgoÌs#(RIt getargspectAssertionErrort decorator(RRR(RO(RRQRPs3/usr/lib/python2.6/site-packages/sqlalchemy/util.pytdecorate·s ((RORV((ROs3/usr/lib/python2.6/site-packages/sqlalchemy/util.pytaccepts_a_list_as_starargs¶sc's–t|ƒ}xƒ|D]{‰tiˆfti‡fd†tdƒƒƒ}xB|D]*}||jo|i|ƒ|VPqPqPWtdˆƒ‚qWdS(Ncsˆt|ƒS((tstr(ti(tbase(s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pytÛsiès&exhausted namespace for symbol base %s(R/t itertoolstchaintimaptxrangetaddt NameError(tusedtbasestpooltsym((RZs3/usr/lib/python2.6/site-packages/sqlalchemy/util.pytunique_symbols×s     cs‡fd†}t|ˆƒS(s'A signature-matching decorator factory.csÆti|ƒ}t|dƒ|dd!|if}t|ddƒ\}}td|d|ƒ}|it|dtƒƒd|}t |hˆ|6||6ƒ}t |d|ƒi |_ t ||ƒS( NiiittargetRtgroupeds1lambda %(args)s: %(target)s(%(fn)s, %(apply_kw)s)tim_func( RIRSRRHRfRR7tformat_argspec_plustFalsetevalR6t func_defaultsR3(RRPtnamest targ_nametfn_nametmetadatatcodet decorated(Rg(s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyRVès%(R3(RgRV((Rgs3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyRUås cCs`g}xM|i|i|ifD]3}t|dƒo|iƒ}n|i|ƒqWt|ƒS(szdecode a slice object as sent to __getitem__. takes into account the 2.5 __index__() method, basically. t __index__(tstarttstoptstepRRttappendR(tslctretR((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyt decode_sliceùscCs|i|i|ifS(N(RuRvRw(Ry((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyR{sccs[xT|D]L}t|tƒ o0t|dƒo x"t|ƒD] }|Vq;Wq|VqWdS(sGiven an iterator of which further sub-elements may also be iterators, flatten the sub-elements into a single iterator. t__iter__N(R+t basestringRtflatten_iterator(Rtelemty((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyR~ s!  c Csòx9|iD]*}d|ijot|gƒ}Pq q WgStƒ}x“|o‹|iƒ}|iidtƒ}| pt|tiƒ oqHnt i |ƒ\}}}}|i |ƒ|o|i |i ƒqHqHW|i dƒt|ƒS(smReturn the full set of inherited kwargs for the given `cls`. Probes a class's __init__ method, collecting all named arguments. If the __init__ defines a \**kwargs catch-all, then the constructor is presumed to pass along unrecognized keywords to it's base classes, and the collection process is repeated recursively on each of the bases. R R(t__mro__R4R/tpoptgetRkR+Rt FunctionTypeRIRSR7t __bases__tdiscardR,( tclstctstackR"tclass_tctrRnt_thas_kw((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pytget_cls_kwargss&      cCsti|ƒdS(s9Return the full set of legal kwargs for the given `func`.i(RIRS(RA((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pytget_func_kwargs3scCsSt|ƒoti|ƒp|}ti|Œ}|do|dd}n$|dod|d}nd }ti|d|d|dƒ}|dd j o|ddt|dƒpd}ti|d|d|d|dd„ƒ}|o td|d |d |d |ƒStd|dd !d |d |dd !d |dd !ƒSd S(sµReturns a dictionary of formatted, introspected function arguments. A enhanced variant of inspect.formatargspec to support code generation. fn An inspectable callable or tuple of inspect getargspec() results. grouped Defaults to True; include (parens, around, argument) lists Returns: args Full inspect.formatargspec for fn self_arg The name of the first positional argument, varargs[0], or None if the function defines no positional arguments. apply_pos args, re-written in calling rather than receiving syntax. Arguments are passed positionally. apply_kw Like apply_pos, except keyword-ish args are passed as keywords. Example:: >>> format_argspec_plus(lambda self, a, b, c=3, **d: 123) {'args': '(self, a, b, c=3, **d)', 'self_arg': 'self', 'apply_kw': '(self, a, b, c=c, **d)', 'apply_pos': '(self, a, b, c, **d)'} iis%s[0]iit formatvaluecSsd|S(t=((R((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyR[bsR"tself_argt apply_postapply_kwiÿÿÿÿN((RRIRSRJRtlenR(RRhRPR"R’R“tdefaulted_valsR”((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyRj7s #  !4! c CsŒyt|d|ƒSWnqtj oed}|tijo|odpd}n|odpd}tddd|d|d |ƒSXd S( s format_argspec_plus with considerations for typical __init__ methods Wraps format_argspec_plus with error handling strategies for typical __init__ cases:: object.__init__ -> (self) other unreflectable (usually C) -> (self, *args, **kwargs) RhRs(self)s(self, *args, **kwargs)sself, *args, **kwargsR’R"R“R”N(RjRtobjectR R(tmethodRhR’R"((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pytformat_argspec_initjs cCsbyti|ƒSWnJtj o>|tijodgdddfSdgdddfSnXdS(súinspect.getargspec with considerations for typical __init__ methods Wraps inspect.getargspec with error handling for typical __init__ cases:: object.__init__ -> (self) other unreflectable (usually C) -> (self, *args, **kwargs) RR"tkwargsN(RIRSRR—R R(R˜((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pytgetargspec_inits cCs.t|tiƒo|i o|iS|SdS(sIAdjust the incoming callable such that a 'self' argument is not required.N(R+Rt MethodTypetim_selfRi(t func_or_cls((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pytunbound_method_to_callable‘scs;t|tiƒotƒSt|gƒ‰t|iƒ}xõ|oí|iƒ}t|tiƒoq<nx;‡fd†|iDƒD] }|i|ƒˆi |ƒqƒW|i djpt |dƒ oq<nxZg}|i ƒD]}|ˆjo ||qãqã~D] }|i|ƒˆi |ƒqWq<WtˆƒS(s†Return an unordered sequence of all classes related to cls. Traverses diamond hierarchies. Fibs slightly: subclasses of builtin types are not returned. Thus class_hierarchy(class A(object)) returns (A, object), not A plus every class systemwide that derives from object. Old-style classes are discarded and hierarchies rooted on them will not be descended. c3s>x7|]0}|ˆjot|tiƒ o |VqqWdS(N(R+Rt ClassType(t.0RŒ(thier(s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pys ®s t __builtin__t__subclasses__( R+RR R,R/RR‚R…RxR`RRR¤(R‡tprocessRˆtbt_[1]RŒts((R¢s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pytclass_hierarchy™s(   !9 ccs\t|ƒ}xI|D]A}x8|iD]-}||ijo||i|fVPq#q#WqWdS(sÉiterate all the keys and attributes associated with a class, without using getattr(). Does not use getattr() so that class-sensitive descriptors (i.e. property.__get__()) are not called. N(tdirRR4(R‡tkeysR Rˆ((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pytiterate_attributes¹s  cCsjt|ttfƒoJ|iƒiƒ}|djotS|djotStd |ƒ‚nt|ƒS(NttruetyestonR€ttt1tfalsetnotofftntft0sString is not true/false: %r(R­R®R¯R€R°R±(R²R³R´RµR¶R·( R+RXtunicodetstriptlowertTrueRkt ValueErrortbool(tobj((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pytasboolÈs  cCs}||jolt||ƒ|j oU||dj oD|tjo|ot||ƒ||s N(RR!titerR'R6RRR«(RÊRÌ((RËRÊs3/usr/lib/python2.6/site-packages/sqlalchemy/util.pytdictlike_iteritemsþs  !cCs–t||ƒo|St|tƒo?tid|did„|Dƒƒtt|ƒƒfƒ‚n/tid|t|ƒtt|ƒƒfƒ‚dS(Ns8Argument '%s' is expected to be one of type %s, got '%s's or css#x|]}dt|ƒVqWdS(s'%s'N(RX(R¡R((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pys s s6Argument '%s' is expected to be of type '%s', got '%s'(R+RRt ArgumentErrortjoinRXR (targtargtypetname((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pytassert_arg_types ?icCst|_td7adS(sÞAssign a '_creation_order' sequence to the given instance. This allows multiple instances to be sorted in order of creation (typically within a single thread; the counter is not particularly threadsafe). iN(t_creation_order(tinstance((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pytset_creation_order s cOs:y|||ŽSWn"tdtiƒdd!ƒnXdS(sNexecutes the given function, catches all exceptions and converts to a warning.s%s('%s') ignorediiN(RLtsystexc_info(RAR"Rš((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pytwarn_exception,ss self.proxycBsÎ|o |}n|djo d}ng}e|ƒD]O}|idƒo9|idƒo)e||ƒ o||jo ||q9q9~}x6|D].} y<e|| ƒ} e| dƒpw˜ne| d | ƒ} Wnej o q˜nXy=ei| ƒ} ei | d ƒ} ei | d d ƒ} Wne j od } d } nXde ƒ}|dj oh||6ph}||Uy| i || _ Wnej onXe || || ƒq˜WdS(s9Automates delegation of __specials__ for a proxying type.t __slots__t__del__t__getattribute__t __metaclass__t __getstate__t __setstate__t__RRiiis(self, *args, **kw)s (*args, **kw)s?def %(method)s%(fn_args)s: return %(name)s.%(method)s%(d_args)sN(s __slots__s__del__s__getattribute__s __metaclass__s __getstate__s __setstate__(RRªt startswithtendswithRR6tAttributeErrorRIRSRJRtlocalsRmR5(tinto_clstfrom_clstskiptonlyRÓt from_instancetdundersR§tmR˜RRPtfn_argstd_argstpytenv((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pytmonkeypatch_proxied_specials3sB    2  !tOrderedPropertiescBsªeZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z d „Z d „Z d „Z d „Zd „Zdd„Zd„Zd„Zd„ZRS(sgAn object that maintains the order in which attributes are set upon it. Also provides an iterator and a very basic getitem/setitem interface to those attributes. (Not really a dict, since it iterates over values, not keys. Not really a list, either, since each value must have a key associated; hence there is no append or extend.) cCstƒ|id/s (R/R(RR÷((R÷s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyt intersection-s csLtˆƒ‰ˆi‡fd†ˆDƒƒ}|i‡fd†ˆDƒƒ|S(Nc3s*x#|]}|ˆjo |VqqWdS(N((R¡R(R÷(s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pys 5s c3s*x#|]}|ˆjo |VqqWdS(N((R¡R(R(s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pys 6s (R/RR7(RR÷R((RR÷s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pytsymmetric_difference3s cs)tˆƒ‰|i‡fd†|DƒƒS(Nc3s*x#|]}|ˆjo |VqqWdS(N((R¡R(R÷(s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pys =s (R/R(RR÷((R÷s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyt difference;s cCsXt|ƒ}ti||ƒg}|iD]}||jo ||q*q*~|_|S(N(R/tintersection_updateR(RR÷R§R((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyRAs 8cCsŠti||ƒg}|iD]}||jo ||qq~|_|ig}|iD]}||jo ||q]q]~7_|S(N(R/tsymmetric_difference_updateR(RR÷R§Rt_[2]((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyRIs8>cCsLti||ƒg}|iD]}||jo ||qq~|_|S(N(R/tdifference_updateR(RR÷R§R((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyRQs8N(R RRR R`RR R†RRR|R*t__str__R7t__ior__Rt__or__Rt__and__Rt__xor__Rt__sub__Rt__iand__Rt__ixor__Rt__isub__(((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyR õs4                 t IdentitySetcBsseZdZeZd'd„Zd„Zd„Zd„Z d„Z d„Z d„Z d„Z d „Zd „Zd „Zd „Zd „Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z!d„Z"d„Z#d„Z$d „Z%d!„Z&d"„Z'e'Z(d#„Z)d$„Z*d%„Z+d&„Z,RS((sÓA set that considers only object id() for uniqueness. This strategy has edge cases for builtin types- it's possible to have two 'foo' strings in one of these sets, for example. Use sparingly. cCs9tƒ|_|o"x|D]}|i|ƒqWndS(N(Rt_membersR`(RRto((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyR cs  cCs||it|ƒs (R$Rö(R((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyR4scCs"t|tƒptS|i|ƒS(N(R+R#R-R(RR÷((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyRscCs|i|ƒi|_dS(N(RR$(RR((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyRscCs&t|tƒptS|i|ƒ|S(N(R+R#R-R(RR÷((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyR! s cCst|ƒ|iiƒƒS(N(R R$Rö(R((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyR%scCs t|iƒS(N(R•R$(R((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyRõscCs |iiƒS(N(R$Rö(R((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyR|scCstdƒ‚dS(Nsset objects are unhashable(R(R((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyt__hash__scCs dt|ƒi|iiƒfS(Ns%s(%r)(R R R$R(R((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyR*sN(-R RRR/R3RR R`RþRR†R‚RR(R)R*R,R.R/R0R1R2RRR7RRRRR"RRRR RR4RRR!R%R$RõR|R7R*(((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyR#YsR                                   tOrderedIdentitySetcBs*eZdefd„ƒYZdd„ZRS(R3cBseZeZRS((R RR»t__sa_hash_exempt__(((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyR3$scCsFti|ƒtƒ|_|o"x|D]}|i|ƒq'WndS(N(R#R RôR$R`(RRR%((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyR +s   N(R RR R3RR (((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyR8#sccs&x|D]}t|ƒ|fVqWdS(s*Generator: ((id(o), o) for o in iterable).N(R&(RR ((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyR52scCsJ|ƒ}g}|D]/}||jo|i|ƒ o ||qq~S(N(R`(tseqt compare_withtseenR§R((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyt unique_list?s tUniqueAppendercBs,eZdZdd„Zd„Zd„ZRS(s½Appends items to a collection ensuring uniqueness. Additional appends() of the same object are ignored. Membership is determined by identity (``is a``) not equality (``==``). cCsv||_tƒ|_|ot||ƒ|_nAt|dƒo|i|_n!t|dƒo|i|_ndS(NRxR`(tdataR#t_uniqueR6t_data_appenderRRxR`(RR?tvia((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyR Js  cCs5||ijo!|i|ƒ|ii|ƒndS(N(R@RAR`(RR ((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyRxUs cCs t|iƒS(N(RÍR?(R((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyR|ZsN(R RRRR RxR|(((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyR>Cs tScopedRegistrycBsGeZdZdd„Zd„Zd„Zd„Zd„Zd„Z RS(sxA Registry that can store one or multiple instances of a single class on a per-thread scoped basis, or on a customized scope. createfunc a callable that returns a new object to be placed in the registry scopefunc a callable that will return a key to store/retrieve an object. If None, ScopedRegistry uses a threading.local object instead. cCs&|ptitƒSti|ƒSdS(N(R—t__new__t_TLocalRegistry(R‡t createfunct scopefunc((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyRDjscCs||_||_h|_dS(N(RFRGtregistry(RRFRG((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyR ps  cCsK|iƒ}y|i|SWn)tj o|ii||iƒƒSXdS(N(RGRHRRRF(RR ((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyRus  cCs|iƒ|ijS(N(RGRH(R((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pythas|scCs||i|iƒ(RÓ(R((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyR*§s(R RR R#R*(((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyRL s  RMcBs)eZdZhZeiƒZd„ZRS(sIA constant symbol. >>> symbol('foo') is symbol('foo') True >>> symbol('foo') A slight refinement of the MAGICCOOKIE=object() pattern. The primary advantage of symbol() is its repr(). They are also singletons. Repeated calls of symbol('name') will all return the same instance. cCsd|iiƒzB|ii|ƒ}|djot|ƒ|i|<}n|SWdtiiƒXdS(N(t_locktacquiretsymbolsRƒRRLRMtrelease(R‡RÓRe((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyRD½s  (R RRRPRJtLockRNRD(((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyRM¬s  c CsW| o| otdƒ‚nt|tƒot||ƒo|St|p9g}t|ƒD]!}|idƒp ||q`q`~ƒ}tt|ƒƒ}ti}t|tƒo |}n*|ptƒ}ti}n t|ƒ}||i |ƒ|ƒo|St|ƒt j oC|tijodpd} td|| di |ƒfƒ‚ndt fd„ƒY} |od |i | _ ntƒ} x…t|ƒD]w\} } | |jotd | ƒ‚nt| ƒptd | | fƒ‚nt| | t| ƒƒ| i| ƒq¦W|| |ƒo| Std di || ƒƒ‚d S(sEnsure basic interface compliance for an instance or dict of callables. Checks that ``obj`` implements public methods of ``cls`` or has members listed in ``methods``. If ``required`` is not supplied, implementing at least one interface method is sufficient. Methods present on ``obj`` that are not in the interface are ignored. If ``obj`` is a dict and ``dict`` does not meet the interface requirements, the keys of the dictionary are inspected. Keys present in ``obj`` that are not in the interface will raise TypeErrors. Raises TypeError if ``obj`` does not meet the interface criteria. In all passing cases, an object with callable members is returned. In the simple case, ``obj`` is returned as-is; if dict processing kicks in then an anonymous class is returned. obj A type, instance, or dictionary of callables. cls Optional, a type. All public methods of cls are considered the interface. An ``obj`` instance of cls will always pass, ignoring ``required``.. methods Optional, a sequence of method names to consider as the interface. required Optional, a sequence of mandatory implementations. If omitted, an ``obj`` that provides at least one interface method is considered sufficient. As a convenience, required may be a type, in which case all public methods of the type are required. s2a class or collection of method names are requiredRŒsany ofsall ofs%r does not implement %s: %ss, tAnonymousInterfacecBseZdZRS(sA callable-holding shell.(R RR(((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyRSst Anonymouss%r: unknown in this interfaces%r=%r is not callables,dictionary does not contain required keys %sN(RR+R R/RªRâtoperatortgetgtRRRÐR—R RÎRR5t staticmethodR`(R¾R‡tmethodstrequiredR§Rìt interfacet implementedtcompliest qualifierRStfoundR˜timpl((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyt as_interfaceÈsF! H          cCsNy ||_Wn:tj o.ti|i|i||i|iƒ}nX|S(sÈReturn a function with a given __name__. Will assign to __name__ and return the original function if possible on the Python implementation, otherwise a new function will be constructed. (R RRR„t func_codet func_globalsRmt func_closure(RRÓ((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pytfunction_nameds  tmemoized_propertycBs#eZdZdd„Zd„ZRS(s2A read-only @property that is only evaluated once.cCs,||_|p|i|_|i|_dS(N(tfgetRR (RRgtdoc((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyR )s cCs3|djodS|i|ƒ|i|i<}|S(N(RRgR4R (RR¾R‡R((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyt__get__.s N(R RRRR Ri(((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyRf's tmemoized_instancemethodcBs#eZdZdd„Zd„ZRS(sàDecorate a method memoize its return value. Best applied to no-arg methods: memoization is not sensitive to argument values, and will always return the same value even when called with different arguments. cCs,||_|p|i|_|i|_dS(N(RgRR (RRgRh((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyR =s cs@ˆdjodS‡‡fd†}ˆi|_ˆi|_|S(NcsPˆiˆ||މ‡fd†}ˆi|_ˆi|_|ˆiˆi<ˆS(NcsˆS(((RR(R(s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyR[Gs(RgR RR4(R"RR((R¾R(Rs3/usr/lib/python2.6/site-packages/sqlalchemy/util.pytoneshotEs   (RR R(RR¾R‡Rk((RR¾s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyRiBs    N(R RRRR Ri(((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyRj5s cCs|ii|dƒdS(N(R4R‚R(RÖRÓ((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pytreset_memoizedPstWeakIdentityMappingcBs–eZdZedƒZd„Zd„Zd„Zdd„Z ed„Z d„Z d„Z d „Z dd „Zd eifd „ƒYZd „ZRS(s)A WeakKeyDictionary with an object identity index. Adds a .by_id dictionary to a regular WeakKeyDictionary. Trades performance during mutation operations for accelerated lookups by id(). The usual cautions about weak dictionaries and iteration also apply to this subclass. tnonecCs&tii|ƒh|_h|_dS(N(tweakreftWeakKeyDictionaryR tby_idt _weakrefs(R((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pyR _s cCs]t|ƒ}||i|<||ijo|i|ƒ|i|RCRERLR RMRaReRfRjRlRpRmRLR}R~RƒR…RR•(((s3/usr/lib/python2.6/site-packages/sqlalchemy/util.pytsÞH  "         $     !      3        (ETdÊ  * Q  T