MINI SHELL

Server : Apache/2.2.2 (Fedora)
System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686
User : apache ( 48)
PHP Version : 5.2.9
Disable Function : NONE
Directory :  /proc/self/root/usr/lib/python2.4/site-packages/mx/Misc/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/usr/lib/python2.4/site-packages/mx/Misc/Namespace.pyo
mò
õÔ5;c@sÍdZdkZdkZdkZdklZdfd„ƒYZdfd„ƒYZdeefd„ƒYZ	ee	ƒd	fd
„ƒYZ
e
ƒZ
dfd„ƒYZd
eefd„ƒYZeeƒdS(s Namespace objects.

    Copyright (c) 1998-2000, Marc-Andre Lemburg; mailto:mal@lemburg.com
    Copyright (c) 2000-2001, eGenix.com Software GmbH; mailto:info@egenix.com
    See the documentation for further information on copyrights,
    or contact the author. All Rights Reserved.
N(sfreezet	NamespacecBs:tZdZd„Zfded„Zeied„Z	fei
eieiei
feied„Zd„Zd„Zd„Zed	„Zed
„Zd„Zd„Zd
„Zd„Zd„Zd„ZeZed„ZeZfed„Z ddd„Z!eZ"e#Z$e%i&e'd„Z(e%i&e'd„Z)RS(s= Base class for Namespaces.

        Instances of this namespace can store arbitrary attributes,
        which are stored in the instances dictionary. They are then
        available via attribute lookup, e.g. ns.attr, and index
        lookup, e.g. ns['attr'].

        The Namespaces support acquisition. To link the object to
        another object, set self.baseobj to the other
        object. Attributes not found in the Namespace instance are
        then looked up in the other object as well.

        NOTE: All methods and internal attributes must start with an
              underscore. Namespace attributes must *not* start with an
              underscore to prevent naming collisions with internal
              variables and methods.  Note that names with leading
              underscore cannot be acquired.

    cKs|o|ii|ƒndS(sV Initializes the namespace with the attributes given
            as keywords.
        N(tkwstselft__dict__tupdate(RR((t5/usr/lib/python2.4/site-packages/mx/Misc/Namespace.pyt__init__"sicCsh}x!|D]}|||ƒ||<q
W|o<x9|iiƒD]$}t	|t
ƒo|iƒqAqAWnd}|ii
ƒ||_dS(s
 Clears the namespace.

            The attributes named in save are not cleared. Per default
            all attributes are cleared. You may want to save the
            baseobj attribute in case you use it.

            Class variables are not cleared this way, but overriding
            instance variables do get deleted.

            If recursive is true (default is false), the namespace is
            cleared recursively, meaning that all Namespace instances
            contained in it are also cleared.

        N(tdtsavetattrtgetattrRt	recursiveRtitemstobjt
isinstanceRt_cleartNonetclear(RRRR
R
RR	((RR*s
cCs>||ƒ|jo|ii|ƒn|ii|iƒdS(sÔ Updates the namespace dictionary with the new entries
            taken from the object other_namespace.

            other_namespace can either be a dictionary or another
            Namespace object.

        N(ttypetother_namespacetDictTypeRRR(RRRR((Rt_updateJs
cCsª||ƒ|jo|iƒ}n
|iƒ}|i}|i}xV|D]N\}
}	||
ƒo5|
|jp||	ƒ|joqHn|	||
<qHqHWd}d}dS(s¼ Updates the namespace with the updated entries taken from
            the object other_namespace provided that the entries already
            exist in the namespace dictionary

            other_namespace can either be a dictionary or another
            Namespace object.

            Attributes listed in save are not overwritten. New values
            having one of the types listed in ignore_types are also
            ignored.

        N(RRRRt_itemsRRRthas_keytexiststktvRtignore_typesR(RRRRRRRRRRR((Rt_loadZs		
 cCs
|iiƒS(sª Returns the current namespace contents as dictionary.

            The dictionaries values should be considered read-only in
            case they are mutable.

        N(RRtcopy(R((Rt_dictionary}scCsdk}|i|ƒS(s  Returns a shallow copy of the current namespace.

            See the standard Python module "copy" for details on the
            copying mechanism.

        N(RR(RR((Rt_copy‡s	cCsdk}|i|ƒS(s Returns a deep copy of the current namespace.

            See the standard Python module "copy" for details on the
            copying mechanism.

        N(RtdeepcopyR(RR((Rt	_deepcopy’s	cCs6y|||ƒSWntj
o}t|‚nXdS(so Index interface to the namespace.

            Raises IndexErrors in case an attribute is not found.

        N(R
RtnametAttributeErrortwhyt
IndexError(RR"R
R$((Rt__getitem__Ÿs
cCs||||ƒS(s+ Index interface to the namespace.
        N(tsetattrRR"tvalue(RR"R(R'((Rt__setitem__­scCs
t|iƒS(sW Return the number of instance attributes stored in the
            namespace.
        N(tlenRR(R((Rt__len__µscCst|iƒdjS(sÝ Returns 1/0 depending on whether any instance attributes
            are defined in the namespace.

            An empty Namespace is false, if it contains at least one
            entry it is true.
            
        iN(R*RR(R((Rt__nonzero__¼scCs
|iiƒS(sx Returns a list of tuples (attrname, attrvalue) for
            all (instance) attributes stored in the object.
        N(RRR(R((RRÉscCs
|iiƒS(sk Returns a list of attribute names for
            all (instance) attributes stored in the object.
        N(RRtkeys(R((Rt_keysÐscCs
|iiƒS(sl Returns a list of attribute values for
            all (instance) attributes stored in the object.
        N(RRtvalues(R((Rt_values×scCs|ii|ƒS(s¸ Returns 1/0 depending on whether the object has
            an instance attribute key or not.

            Note that class attributes cannot be queried this way.
            
        N(RRRtkey(RR1((Rt_has_keyÞscCs|ii||ƒS(se Returns the value of attribute key, or default if no
            such attribute is defined.
        N(RRtgetR1tdefault(RR1R4((Rt_getëscCs||i||ƒS(so Extract a list of named objects from the namespace.
        
            defaults may be given as sequence of the same size as
            names to provide default values in case names are not
            found in the namespace.

            Only the instance dictionary is scanned, the class
            variables are not available through this mechanism.

        N(textractRRtnamestdefaults(RR7R8R6((Rt_extract÷s
cCsÛt|ƒ}h}|oO|oGx²|iiƒD]/\}}|| |jo||||<q2q2Wnoxk|iiƒD]Z\}}|| |jo=|o|oqyn|o|||<qÓ||||<qyqyW|S(s” Find all attributes having prefix as common prefix and return
            a dictionary mapping the attribute suffixes (the prefix
            is removed) to their values.
            
            If nonzero is set, then only fields with non-zero value
            are included in the dictionary

            If wholename is true, the prefix is not removed from the
            attribute names.

        N(R*tprefixtplenRtnonzerot	wholenameRRRRR(RR:R<R=RRR;R((Rt_prefixgroups"cCsH|iiƒ}|iƒd|ii|ii||dƒ||ƒfS(Ns<%s.%s (%s) at 0x%x>t,(	RRR-tsortt	__class__t
__module__t__name__tjointid(RRDRER-((Rt__repr__0s
cCsç|iiƒ}|iƒd|ii|ii||ƒfg}x“|D]‹\}}yt|ƒ}Wn"t
ttfj
o
d}n1Xt|ƒdjo|d dt|ƒ}n|id|d|fƒqHWti|dƒS(Ns%s.%s at 0x%x:s*** repr(value) failed ***iÈs!... (truncated, full length = %i)s    %-10s %st:s
(RRRR@RARBRCREtlRRtreprtst
ValueErrort	TypeErrorR#R*tappendtstringRD(RRDRERRHRJRR((Rt__str__<s
((*RCRBt__doc__RR
RttypesRRRtBuiltinMethodTypet	ClassTypet
MethodTypetFunctionTypeRRRR!R&R'R)R+R,RR.R0R2t_hasattrRR5t_getattrR6R9R>tbaseobjtacquiret__getattr__RNRDRERFRO(((RRs2	 0#	
		
		
				!tDefaultMixincBstZdZdZd„ZRS(sR Mixin that provides default attribute values.

        The namespace returns _default for all undefined attributes
        (except the ones that start with an underscore, see
        __getattr__). The _default is defined as '' for this class.

        The acquisition feature is *not* available for instances of this
        class.

    tcCs%|ddjo
t|‚n|iS(s† Return self._default for all undefined attributes that don't
            start with an underscore.

            For attributes that start with an underscore, raise an
            AttributeError. This is especially important if the
            objects are to be pickled, since the pickle mechanism
            queries a few methods on the objects, which it then calls.
            
        it_N(R"R#Rt_default(RR"((RRZ`s

(RCRBRPR^RZ(((RR[RstNamespaceWithDefaultcBstZdZRS(s[ Namespace class with an infinite number of attributes.

        The namespace returns _default for all undefined attributes
        (except the ones that start with an underscore, see
        __getattr__). The _default is defined as '' for this class.

        The acquisition feature is *not* available for instances of this
        class.

    (RCRBRP(((RR_qst	_NotFoundcBstZRS(N(RCRB(((RR`‚stFormatNamespaceMixincBstZdZed„ZRS(se This mixin makes a Namespace class conform to the Python
        format string mechanism.

        The following format specifiers are supported:

        %(attribute)s		- gives the string representation
        			  of .attribute
        %(<eval-string>)s	- evaluates the <eval-string> in the
        			  Namespace dictionary and returns
                                  the string representation

        All standard Python string formatting output types are
        supported, provided that the attribute or evaluation result
        can be converted to these types.
                                  
    cCs7t|||ƒ}||j	o|Snt||iƒS(N(R
RtitemR`R
tevalR(RRbR`R
((RR&™s
(RCRBRPR`R&(((RRa†stFormatNamespacecBstZdZRS(sØ Namespace class which supports the Python format string
        lookup mechanism.

        These Namespaces can be used in 'format string' % namespace
        formatting.

        The following format specifiers are supported:

        %(attribute)s		- gives the string representation
        			  of .attribute
        %(<eval-string>)s	- evaluates the <eval-string> in the
        			  Namespace dictionary and returns
                                  the string representation
                                  
        All standard Python string formatting output types are
        supported, provided that the attribute or evaluation result
        can be converted to these types.
                                  
    (RCRBRP(((RRd¤s(
RPRNRQtmx.Tools.NewBuiltinstmxtmx.ToolstfreezeRR[R_R`RaRd(
R[R`R_RNRaRRhRfRQRd((Rt?s	
ÿG
	

Anon7 - 2021