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/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/usr/lib/python2.4/site-packages/mx/Log.pyc
mò
€š<c@sydZdkZdkZdkZdkZdklZeeeeef\ZZZ	Z
Z[[[[[dkZ[dZ
dZdZdZdZdZd	Zd
ZdZdZd
ZdZdZeZdZd	ZdZdZe
ie
i e
i!e
i"e
i#e
i$e%fZ&e'd„Z(e'd„Z)e'd„Z*d„Z+ei,ddde&e'd„Z-ei,ddde&e'd„Z.dddfe'd„Z/ei,ddfe
i0ei1d„Z2ei,ddfe'e
i0d„Z3ei,ddfe'd„Z4ei,ddd„Z5ei,dddd „Z6ei,eed!„Z7d"„Z8d#fd$„ƒYZ9e:oe9eƒZ;ne9edƒZ;dS(%sé Standard Logging Interface

    Creates an object log, that can be used for global logging
    activities. The properties can later be changed by calling
    log.setup().
    
    It is safe to do a 'from mx.Log import *'.

    Copyright (c) 1999-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(sDateTimeiiii
iidiôiXi¸ièiÐi'iPi2cOs`|djotiƒd}nx|idjo
|i}q$Wtt|if||ƒdS(s: Print a listing of the traceback's locals() to file.
    iN(
ttbtNonet_systexc_infottb_nexttapplytprint_frame_localsttb_frametargstkws(RRR	((t*/usr/lib/python2.4/site-packages/mx/Log.pytprint_tb_locals<s
cOs`|djotiƒd}nx|idjo
|i}q$Wtt|if||ƒdS(s; Print a listing of the traceback's globals() to file.
    iN(
RRRRRRtprint_frame_globalsRRR	(RRR	((R
tprint_tb_globalsHs
cOs—|djotiƒd}nx|idjo
|i}q$W|ii|iij	ott	|if||ƒntt|if||ƒdS(s© Print a listing of the traceback's locals() and globals() to file.

        If locals() and globals() are the same object, only the
        globals() are printed.

    iN(
RRRRRRtf_localst	f_globalsRRRR	R(RRR	((R
t
print_tb_varsTs
cCs3t|ƒtijo|d djodSndS(s… Filters all attributes which start with an underscore.

        For use as filter argument to one of the print_xxx() APIs.
    
    it_iN(ttypetkeyt_typest
StringType(R((R
tfilter_private_attributesgs's#  s### Dump of local variables:
c	Cs>|o|i|ƒnt|i|||d|d|ƒdS(s7 Print a listing of the locals() in frame to file.
    tnonrecursivetfilterN(
ttitletfiletwritet
print_dicttframeRtindenttlevelsRR(RRRRRRR((R
Rss
s### Dump of global variables:
c	Cs>|o|i|ƒnt|i|||d|d|ƒdS(s8 Print a listing of the globals() in frame to file.
    RRN(
RRRRRRRRRR(RRRRRRR((R
Rs
tc
Csœ|iƒ}|iƒt|ƒtjo|t }|idƒnxQ|D]I\}}
|d
j	o||ƒpqKq|n|o$yt|ƒ}	Wq³d}	q³Xn
t|ƒ}	yt|
ƒ}Wn
d}nXt|	ƒtjo|	t d}	nt|ƒtjo|t d}n|o|id||	|fƒn|id||	|fƒ|djo+t|
||d|dd|d	|ƒqKqKWd
S(s™ Print dictionary to file.

        reprkeys=1 will print the items using repr() for keys as well.
        indent is prepended to all lines. levels indicates the number
        of recursion levels to be printed.

        filter may be given as callable taking the dictionary key as
        input. It should then return 1 for keys which should be
        displayed and 0 for ones which should be skipped.

    s...s...truncated...s*repr()-error*s%s %-15s = %s
s%s.%-15s = %s
is  RRN(s...s...truncated...(tdicttitemstltsorttlent_DICT_LEN_LIMITtappendtktvRRtreprkeystreprtntstrtrt_NAME_LEN_LIMITt_VALUE_LEN_LIMITRRRRtprint_recursiveR(R!RRRR*RRR(R#R,R)R.((R
Rs>






cCs£g}d}	yt|ƒ}Wnttfj
odSnXx¾tt|t	ƒƒD]§}
y||
}WnPnXyt|ƒ}
Wn
d}
nXt|
ƒt	jo|
t	 d}
n|i||
fƒt|ƒ|jpt|ƒdjo
d}	qRqRWt|ƒt	jo|id
ƒn|	owxtt|ƒD]b\}
\}}|id|d|
|fƒ|djo%t|||d|dd	|ƒq5q5WndS(Nis*repr()-error*s...is...truncated...s
%s%-15s = %s
s[%i]s  R(s...s...truncated...(R#tunfoldR%tobjtlengthtAttributeErrort
ValueErrorttrangetminR0titvalueR+R.R'RRtirangetrvalueRRRRR1R(R3RRRRRtjoinR4R<R2R9R#R:R.((R
tprint_sequence¾s<	
&

c	
CsHy,t|ƒ|jp
||jodSnWndSnXt|dƒo&t|i|||d|d|ƒnÕt|dƒo&t||||dd|d|ƒnŸt
|ƒo1t|ƒ|jot||||d|ƒnat|dƒoPh}x$|iD]}t||ƒ||<qWt||||d|d|ƒndS(Nt__dict__RRR"it__members__(RR3RthasattrRR?RRRRt
issequenceRR>tdR@tattrtgetattr(	R3RRRRRRRCRD((R
R1ás* !
cCsyt|ƒ}Wn
d}nXt|ƒtjo|t d}n|id||fƒt|||d|dd|ƒdS(Ns*repr()-error*s...s%s%s
s  iR(R+R3R.R%R0RRRR1RR(R3RRRRRR.((R
t	print_objs
cCs$t|d|d|dddƒdS(NRtoffsetitlocals(tprint_stackRRRG(RRRG((R
tprint_stack_with_localssc
CsSyddWn^tj
oRtiƒdi}x:t|dƒD]#}|idj	o
|i}qAqAWnXg}	x"|o|	i|ƒ|i}qvW|	iƒt
iƒ}|idƒx‘t|	|ƒ|D]{\}\}}}}
|id|||fƒ|
o|idti|
ƒƒn|ot||ddd	d
ƒqÐqÐWdS(NiiisStack:
s File "%s", line %d, in %s
s  %s
Rs   |RR (tZeroDivisionErrorRRRtftrangeRGR9tf_backRtframesR'treverset
_tracebackt
extract_stacktstackRRttuplesRRtfilenametlinenotnametlinet_stringtstripRHR(
RRRGRHRWRLR9RRVRORXRURS((R
RIs.


c	Csñ|iiƒ}|iƒ|idƒxÄ|D]¼\}}|i
|dƒ}x(tt
|ƒdƒD]}d||<qbW|i|dƒ}|d
j	oTt|dƒo/|id|i|d dƒ|dfƒqé|id	|ƒq-q-Wd
S(s: Print a listing of currently loaded modules to file.
    sLoaded modules and packages:
t.is   R t__path__s %s[%s]
iÿÿÿÿs %s
N(tsystmodulesR"R#R$RRR(R)tstringtsplittpRMR%R9R=R,RRA(	RR_R]R9R(R#R,RaR)((R
tprint_loaded_modules.s


/cCsFdk}|iƒ}tit|ƒttiƒd|ƒ|i	ƒS(s¸ Formats a traceback of the current exception and
        returns it as string.

        Includes a listing of the locals() causing that were
        active during the exception.

    Ni(
t	cStringIOtStringIORLRQt	print_exct_TRACEBACK_LIMITRRRtgetvalue(RcRL((R
tformat_tracebackDs	tLogcBsòtZdZeZdZeZeZdZ	dZ
edeed„Zd„Zd„Z
d„Zd	d
„Zeeeed„Zd„Zd
„Zd„Zd„Zd„Zdd„Zd„ZeZd„Zdd„Zd„Zd„ZRS(s Log class.
    sdefault.logR itstderrcCs§|dj	o
||_n|dj	o|d|_n||_dk}|pdt|iƒƒ|_n|dt|iƒƒ|_t	i
|_t	i|_
dS(si Setup a log object which writes its output to log_file
            using the given id marker. 

            The ignore_level indicates the level at which logging
            activities are ignored. A low value causes less important
            notices like SYSTEM_INFOs to be ignored. If it is set to
            0, no logging is done. 

            Alternatively, log_level may be specified giving the last
            level to log (all higher levels are ignored).

            The log id can be set to separate multiple
            threads/processes in the log. It defaults to the process
            id.

        iNRat:(tignore_levelRtselft	log_leveltlog_filetostlog_idR-tgetpidRRjtorig_stderrtstdouttorig_stdout(RmRlRoRqRnRp((R
t__init__bs


		cCs
|t_dS(s7 Redirects stderr output to the log mechanism.
        N(RmRRj(Rm((R
tredirect_stderr‚scCs
|t_dS(s7 Redirects stdout output to the log mechanism.
        N(RmRRt(Rm((R
tredirect_stdoutˆscCs|it_|it_dS(s^ Reset stderr and stdout to their values when the log object
            was created.
        N(RmRsRRjRuRt(Rm((R
tdisable_redirectsŽstacCs|i}|djo
|i}n^|djo
|i}nDyt|i|ƒ}Wn*|i|_}t	t
d|iƒnX||_|S(sh Open the log file. 

            This is done on-the-fly in case a log request is
            encountered and the file is still closed.  This interface
            also supports redirecting messages to stderr or stdout by
            using 'stderr' or 'stdout' as log file name.  If the log
            file cannot be opened, stderr is used instead.

        RjRts+Could not open log file "%s" - using stderrN(RmRoRURsRRutopentflagst
open_log_filetlogtSYSTEM_ERROR(RmR|RUR((R
R{–s
	



	cCs–|dj	o
||_n|dj	o|d|_n|dj	o||_d|_n|dj	o*dk}|dt|i	ƒƒ|_ndS(s’ Change the setup after creation
            - use keywords to change only certain aspects, e.g.
              setup(log_file = 'my.log')
        iNRk(
RlRRmRnRoR}RqRpR-Rr(RmRlRoRqRnRp((R
tsetup±s



	

	cGs²||ijodSnt|ƒdjo|d|d}n(t|ƒdjo|d}nd}|ip
|iƒ}|i	d|t
iƒ|i|fƒ|i
ƒdS(sŸ Default logging mechanism: errno contains the error id and
            the remaining arguments get interpreted as:
            arg0 % (arg1,arg2,...)
        NiiR s%04i %s [%s] %s
(terrnoRmRlR%RtsR}R{RLRt	_DateTimetnowRqtflush(RmRRRLR‚((R
t__call__Ãs&cGs||ijodSnt|ƒdjo|d|d}n(t|ƒdjo|d}nd}|ip
|iƒ}|i	d|t
iƒ|i|fƒ|i	dddƒt
it|ƒttiƒd	|d
ddtƒ|i	dddƒ|iƒdS(
sC Write a traceback of the last exception to the log file.

        NiiR s%04i %s [%s] %s...
iOt-s
iRs5### Dump of local variables (omitting private ones):
R(RRmRlR%RR‚R}R{RLRRƒR„RqRQReRfRRRRR…(RmRRRLR‚((R
t	tracebackÕs"&
cGsæ||ijodSnt|ƒdjo|d|d}n(t|ƒdjo|d}nd}|ip
|iƒ}|i	d|t
iƒ|i|fƒ|i	dddƒt
|ƒ|i	dddƒ|iƒdS(	sG Write a list of all currently loaded modules to the log file.
        NiiR s%04i %s [%s] %s...
iOR‡s
(RRmRlR%RR‚R}R{RLRRƒR„RqRbR…(RmRRRLR‚((R
R^îs&
cOs||ijodSnt|ƒdjo|d|d}n(t|ƒdjo|d}nd}|iddƒ}|iddƒ}|i
p
|iƒ}|i
d|tiƒ|i|fƒ|i
d	d
dƒt|d|ddd|ƒ|i
d	d
dƒ|iƒdS(
sš Write a stack dump to the log file.

            A keyword argument "levels" can be given to set the number
            of stack frames to show. It defaults to 3. Higher values
            can result in huge amounts of data to be written to the
            log file !

            If a keyword argument "locals" is given and false, no
            locals are printed in the dump. It defaults to true.

        NiiR RiRHs%04i %s [%s] %s...
iOR‡s
RG(RRmRlR%RR‚R	tgetRRHR}R{RLRRƒR„RqRIR…(RmRRR	RLR‚RRH((R
RSs &cGsÝ||ijodSnt|ƒdjo|d|d}n(t|ƒdjo|d}nd}|ip
|iƒ}|i	d|t
iƒ|ifƒ|i	dddt
i|ƒddd	ƒ|iƒdS(
s® Write args[0] % args[1:] to the log file. This method
            is meant for multi line messages, since the logged text
            is not manipulated in any way.
        NiiR s
%04i %s [%s]
iOR‡s
%s
s
(RRmRlR%RR‚R}R{RLRRƒR„RqRYRZR…(RmRRRLR‚((R
tverbatim#s#.icCsy||ijodSndkl}|ip
|iƒ}|id|t	i
ƒ|i||dƒfƒ|i
ƒdS(s Log a function call.

            level indicates how far up the calling stack to look for
            the call information. Default is one level meaning the
            directly calling function.

            Note: Needs mx.Tools.func_call() API.
            
        N(s	func_calls%04i %s [%s] %s
i(RRmRltmx.Toolst	func_callR}R{RLRRƒR„RqtlevelR…(RmRRRŒRL((R
tcall5s

0cGsæ||ijodSnt|ƒdjo|d|d}n(t|ƒdjo|d}nd}|ip
|iƒ}|i	d|t
iƒ|i|fƒ|i	dddtit|ƒƒddd	ƒ|iƒdS(
sÉ Write errorname, args[0] % args[1:] to the log file.

            This method is meant for multi line error messages that
            hold additional data referring to the error.
            
        NiiR s%04i %s [%s] %s
iOR‡s
%s
s
(RRmRlR%RR‚R}R{RLRRƒR„Rqt	errornameRYRZR-R…(RmRRRRLR‚((R
terrorGs&4c	Gs5||ijodSnt|ƒdjo|d|d}n(t|ƒdjo|d}nd}dkl}||ƒ}x6t	t|ƒƒD]"}d|d||f||<q”W|ip
|iƒ}|id|tiƒ|i|fƒ|idd	d
ti|dƒdd	dƒ|iƒdS(s$ Write errorname and a line numbered version of args[0] %
            args[1:] to the log file.

            This method is meant for multi line error messages that
            hold additional data referring to the error.

            Needs mx.TextTools to be installed.
            
        NiiR (s
splitliness%04i %ss%04i %s [%s] %s
iOR‡s
%s
s
(RRmRlR%RR‚tmx.TextToolst
splitlinesR#RMR9R}R{RLRRƒR„RqRRYR=R…(	RmRRRRLR9R#R‚R’((R
ttext_s"

 &1icCsŸ||ijodSn|ip
|iƒ}|id|tiƒ|i	|fƒ|idddƒt||d|ƒ|idddƒ|iƒdS(s° Write objname plus a dump of object to the log file.

            levels indicates how many levels of the object hierarchy
            should be written.
            
        Ns%04i %s [%s] %s
iOR‡s
R(RRmRlR}R{RLRRƒR„RqtobjnameRFtobjectRR…(RmRR”R•RRL((R
R•{s&cCs|idjodSn|i||_}d|jodSnti|dƒ}|ddjo|d|_|d }n
d|_|ip
|i	ƒ}tiƒ}|i
}xB|D]:}ti|ƒpqºn|idd|||fƒqºW|iƒdS(s¬ File interface, so that the object can be used as
            _sys.stderr replacement.

            Errorcode 0 is used. The output is line buffered.
            
        iNs
iÿÿÿÿR s%04i %s [%s] %s
(RmRltline_buffertdatatbufferRYR`tlinesR}R{RLRƒR„RqtidRXRZRR…(RmR—RLR˜R™RXR„Rš((R
Rs(

		!c

Gs0||ijodSntiƒ\}	}}|	djodSnt	|ƒdjo|d|d}n(t	|ƒdjo|d}nd}|}x|i
dj	o
|i
}q›W|i}|ip
|iƒ}|id|tiƒ|i||iiti|ƒ|	|fƒ|iƒ~	~~dS(s/ Log a real exception in the log file.
        NiiR s'%04i %s [%s] %s (at '%s':%i - %s:'%s')
(RRmRlRRt	exc_classtexc_instt
exc_tracebackRR%RR‚RRRRR}R{RLRRƒR„Rqtf_codetco_filenameRQt	tb_linenoR…(
RmRRRœRLRR‚RRR›((R
t	exception¯s(
	A
(t__name__t
__module__t__doc__tSYSTEM_LOG_EVERYTHINGRlRoRRqR}R–tclosedRvRwRxRyR{R€R†RˆR^RSRŠRŽRtlongR“R•RR¡(((R
RiUs2 							 				 (<R¤R]R_ttypesRˆtmxtDateTimeRRYRƒRRQtmx.Tools.NewBuiltinstSYSTEM_ALWAYS_LOGtSYSTEM_FATALtSYSTEM_PANICRt
SYSTEM_CANCELtSYSTEM_IMPORTANTtSYSTEM_WARNINGtSYSTEM_MESSAGEtSYSTEM_UNIMPORTANTtSYSTEM_INFOtSYSTEM_DEBUGt
SYSTEM_ANYtSYSTEM_LOG_NOTHINGR¥R/R0RfR&t
ModuleTypetFunctionTypet
MethodTypetBuiltinFunctionTypetBuiltinMethodTypet	ClassTypet__builtins__t_NON_RECURSIVERRR
RRRtRRRRR=R>R1RFRJRIRbRhRit	__debug__R~(.R­RiR¿R>RIRRªR°RƒRµR¯RFR±R¥R®R1R²RRQR³RRRR_RR/R´R¶R¬R]RYRfR¨R~RRhRˆRbRR0R·RJRR&R©R
((R
t?sX$
$	-	/$#! 
	ÿz

Anon7 - 2021