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/Tools/mxTools/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/usr/lib/python2.4/site-packages/mx/Tools/mxTools/hack.pyc
mò
{:"<c@spdZdZdZdkZdkZdkZdkZdkZdZed„Z	d„Z
eidƒZdei
eeieieied	„Zd
dd„Zd„Zd
ded„Zdded„Zdded„Zdded„Zdded„Zd„Zdd„Zdfd„ƒYZdd„Zd„Zdded„Zddd„Z d„Z!dS(s÷ Hacking Tools for Python

    (c) 1997-2000, Copyright by Marc-Andre Lemburg (mal@lemburg.com); 

         All Rights Reserved.

    Permission to use, copy, modify, and distribute this software and
    its documentation for any purpose and without fee or royalty is
    hereby granted, provided that the above copyright notice appear in
    all copies and that both the copyright notice and this permission
    notice appear in supporting documentation or portions thereof,
    including modifications, that you make.

    THE AUTHOR MARC-ANDRE LEMBURG DISCLAIMS ALL WARRANTIES WITH REGARD
    TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
    MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE AUTHOR BE
    LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
    DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
    WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
    ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
    PERFORMANCE OF THIS SOFTWARE !

s0.5s(
BEGIN PYTHON-PACKAGE-INFO 1.0
Title:                  Hacking tools for Python
Current-Version:        0.5
Home-Page:              http://www.lemburg.com/python
Primary-Site:           http://www.lemburg.com/python/hack.py

This module includes some tools that I find useful to examine
code from inside an interactive interpreter session. It includes
functions to display doc strings, dictionaries, sequences, etc.
in a more or less nice format and common stuff like disassembly
routines, timing gadgets and exception helpers.
END PYTHON-PACKAGE-INFO
Ns    cCsMyIt|ddƒt|idƒt|dƒoH|d|iGHnWntj
onXHg}y|i	iƒ}Wntj
o
g}nXy4x-|i
D]"}|i|t
||ƒfƒq¢WWntj
onX|oc|iƒxV|D]J\}}t|dƒo.|io$t||dƒt|idƒq÷q÷WndS(	s! doc(c) -- print c's doc-strings tiit__version__s
[Version: %s]t__doc__iN(t
showobjecttct
showdocstringRthasattrtINDENTRtAttributeErrortitemst__dict__t__methods__tmtappendtgetattrtsorttnametobj(RRRRR	R((t9/usr/lib/python2.4/site-packages/mx/Tools/mxTools/hack.pytdocs.s8
$
c	Cst|dƒo
|i}n|i}|i}|i}t	|i
| ƒ}|io¹t
|ƒt
|iƒ}x|iD]Ž}yt|ƒ}Wn
d}nXt
|ƒdjo|d d}n||}|ddjo
d}nd||f||<|d	}qxWn|id
@o&|id|i
|ƒ|d	}n|id@o&|id
|i
|ƒ|d	}nd|ti|dƒfS(sÛfunc_sig(func)

       Returns the signature of a Python function/method as string.
       Keyword initializers are also shown using
       repr(). Representations longer than 100 bytes are truncated.

       XXX Anonymous arguments ((a,b,c)=(1,2,3)) are not supported and
           probably never will be since they require disassembling the
           byte code which is bound to fail once byte code optimizers find
           their way into every Pythoneers home...

    tim_funcs<repr-error>ids...it.s(...)s%s=%siit*is**s%s(%s)s, N(RtfuncRt	func_codetcodetco_nametfnametco_argcounttcallargstlisttco_varnamestargst
func_defaultstlentitdefaulttreprtrtargtco_flagsR
tstringtjoin(	RRRR#R R$R&RR'((Rtfunc_sigPs:

			




s
([ ]*)[^ ]icCs)y|||ƒdƒ}WndSnXt|ƒdjo¬ti}t||ƒ}xct
dt|ƒƒD]L}	|i
||	ƒ}|o,|idd}
|
|jo
|
}q´qhqhW||dƒgt|d„|dƒ}nt||ƒ}t||d„|ƒ}||dƒd}
|
GHdS(Ns
\|
\|
iicCs||S(N(txtindent(R,R-((Rt<lambda>—scCs|||S(N(RtnR,(R,R/R((RR.šss
(tsplittstriptdoctlR"tsystmaxintR-tmapt
expandtabstrangeR#tspacestmatchRtregstsptlevelRR*ts(R2R=R0RR*R1R7R9R-R#R<RR3R>((RRs(	
.RcCsìt|ƒtitifjo0yt|ƒ}Wqtj
o
|}qXnOt|ƒti	jod|}n+t|ƒti
jod|}n|}|p3y
|i}Wq×tj
ot|ƒ}q×Xnt
||GdGHdS(NsModule sClass t:(ttypeRttypestFunctionTypet
MethodTypeR+tobjreprRRt
ModuleTypet	ClassTypet__name__R%RR=(RRR=RD((RRžs 
cCs8dGHddGHt|ƒHdGHddGHt|dƒdS(s4 info(c) -- print all the information known about c sDocumentation:t-iHsAttributes, Internals, etc.:iN(RRtshow(R((Rtinfo´s	
	icCsþyHt|ƒ}t|ƒdjo|d d}nd|||fGHWndSnX|d}||jodSnt|d||ƒt|d||ƒt|d||ƒt	|d	||ƒt	|d
||ƒt	|d||ƒt
|d||ƒdS(
s) show(c) -- print all the internals of c i(s ...s%s%sNiRGt	__class__t	__bases__Rt__members__t__attributes__R
(R%RR&R"RR=tmaxdepthtshowobjtshowseqtshowattrtshowdict(RROR=RR&((RRIÀs$

ic	Cs3yt||ƒ}|iƒWntj
odSnXd|||fGH|d}||jodSnxÃ|D]»}yt||ƒ}t|ƒ}Wnd}d}nXt|ƒdjo|d d}n||jo8|dj	o+d|||fGHt|||dƒqpd||||fGHqpWdS(s0 showattr(c,name) -- for a in c.name: print c.a Ns%s%s :is*exception*i(s ...s	%s%s : %s(RRRR	RRRR=ROR,taR%R&tNoneR"RI(	RRROR=RRTR	R&R,((RRRÜs0	


cCssyt||ƒ}Wntj
odSnXd|||fGH|d}||jodSnt|||ƒdS(s( showobj(c,name) -- print object c.name Ns%s%s :i(	RRRR,RRR=RORI(RRROR=RR,((RRPûs	

cCs9yt||ƒ}Wntj
odSnXd|||fGH|d}||jodSn|pd|||fGHdSnx±|D]©}yt	|ƒ}Wnd}d}nXt|ƒdjo|d d}n||jo8|dj	o+d|||fGHt
|||dƒqˆd|||fGHqˆWdS(s* showseq(c,name) -- print sequence c.name Ns%s%s :is%s%ss*exception*i(s ...(RRRR	RRR=ROR,R%R&RUR"RI(RRROR=RR	R&R,((RRQs2	


cCsy)t||ƒ}|iƒ}|iƒWntj
odSnXd|||fGH|d}||jodSn|pd|||fGHdSnxÿ|D]÷\}	}yt|	ƒ}Wn
d}nXt|ƒdjo|d d}nyt|ƒ}
Wnd}
d}nXt|
ƒdjo|
d d}
n||jo8|dj	o+d|||fGHt|||dƒqžd||||
fGHqžWdS(	s* showdict(c,name) -- print c.name.items() Ns%s%s :is%s%ss*exception*i(s ...s	%s%s : %s(RRRtdictR	RRRR=ROtkeytvaluetstrtkR"R%tvRURI(RRROR=RR	RZRXRVRWR[((RRS-sB	



cCs¥t|ƒtijot|ddƒ}n`t|ƒtijo
|i}n=t|ƒtijpt|ƒtijo|i	i}ndk
}|i|ƒdS(s[ dis(c) -- disassemble c; can be a code-string, -object a function
        or a method
    thackingtexecN(R@RRAt
StringTypetcompileRBRRCtUnboundMethodTypeRtdistdisco(RRa((RRaXs
,	cBsKd|d}e|ddƒ}|o||Undk}||iUdS(s clock(code[,namespace]) -- clock the code executed in namespace which
        defaults to the top level namespace __main__.
    s0import time;hack_timer=time.time(),time.clock()
sl
hack_timer=time.time()-hack_timer[0],time.clock()-hack_timer[1]; print '%.3fabs %.3fusr sec.' % hack_timer
shack.clock-codeR]NR(RR_Rt	namespacet__main__R
(RRcRRd((Rtclockfs	ttimercBswtZdZdZdZeieid„Zeieid„Zeieid„Z	eieid„Z
d„ZRS(s timer class with a quite obvious interface
        - .start() starts a fairly accurate CPU-time timer plus an
          absolute timer
        - .stop() stops the timer and returns a tuple: the CPU-time in seconds
          and the absolute time elapsed since .start() was called
    icCs|ƒ|_|ƒ|_dS(N(ttimetselftatimeRetutime(RhReRg((RtstartƒscCs6|ƒ|i|_|ƒ|i|_|i|ifS(N(ReRhRjRgRi(RhReRg((RtstopˆscCs-|ƒ|i|_|ƒ|i|_|iS(N(ReRhRjRgRi(RhReRg((RtusertimeŽscCs-|ƒ|i|_|ƒ|i|_|iS(N(ReRhRjRgRi(RhReRg((Rtabstime”scCsd|i|ifS(Ns%0.2fu %0.2fa sec.(RhRjRi(Rh((Rt__str__šs(RGt
__module__RRjRiRgReRkRlRmRnRo(((RRfwscBsKd|d}e|ddƒ}|o||Undk}||iUdS(s… profile(code[,namespace]) -- profile the code executed in namespace
        which defaults to the top level namespace __main__.
    simport profile;profile.run("s")t	profilingR]N(RR_RRcRdR
(RRcRRd((Rtprofiležs	cCsbttdƒoIti}x|idjo
|i}qW|i}dGHt|i	ƒndGHdS(s5 why() -- show locals that caused the last exception tlast_tracebackslocals() of the last exception:sno exception available !N(
RR4Rsttbttb_nextRUttb_frametframeRVtf_locals(RwRt((Rtwhy«s		ic	Cst|dƒo||dGH||joÈ|iƒ}|iƒx¼|D]£\}}||dG|GdGHygt	|||dƒ}|oFt|ƒ}t
|ƒdjo|d d}n|d|G|GHnWqG|d|GdGHqGXqGWn||GdGH||d	GHdSnd
SdS(sI dict(d,maxindent,indent) -- show dict d with given indentation (=0)
    R	t{t R?ii(s...s*exception*t}sError: no items-methodN(RtdR-Rt	maxindentR	RRZR[RVt
print_hereR%R>R"RU(	R}R~R-RRR	RZR>R[((RRV¹s,




i
cCsæyŽt|ƒt|ƒtdƒjp
||jo
t‚nx@|D]8}yt|||dƒWqDtj
odGqDXqDW|dGHdSWnQtj
oE|dGt	|ƒ}t|ƒdjo|d d}n|GHnXdS(s” seq(l,maxindent=10,indent=0) 
        -- show sequence l with given indentation (=0), limiting
            the indent-depth at maxindent (=10)
    Ris*exception*s |Ni(s...(R"R3R@R-R~t	TypeErrorR#tseqt
ValueErrorR%R>(R3R~R-R#R>((RRÕs&
&

	cCsÙtiiƒ}|iƒdGHx´|D]¬\}}ti|dƒ}x(t
t|ƒdƒD]}d||<qZWti
|dƒ}|d
j	oDt|dƒo'dti
|d dƒ|dfGHqÑd	|GHq%q%Wd
S(s€ modules() -- pretty print a list of loaded modules and packages;
        cached miss entries in sys.modules are not shown.
    sLoaded modules and packages:Ris   Rt__path__s %s[%s]iÿÿÿÿs %sN(R4tmodulesR	R3RRZR[R)R0tpR8R"R#R*R/RUR(R#RZR3R/R…R[((RR„ñs

'("RRt__package_info__RAR4RgR)treRRR+R_R9R0R*R1R7RRRJRIRRRPRQRSRaRUReRfRrRyRVRR„(RRIRRR9R†ReRRSRyR‡RVRR+RrR)RR4RQRRPRARJRR„RfRgRa((Rt?s.-"	-*	!+	'
	

Anon7 - 2021