%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python2.7/
Upload File :
Create Path :
Current File : //usr/local/lib/python2.7/bdb.pyo


Mac@sdZddlZddlZddlZddlZdddgZdefdYZdfdYZdZ	dfd	YZ
d
ZdZdefd
YZ
dZdZdZdS(sDebugger basicsiNtBdbQuittBdbt
BreakpointcBseZdZRS(sException to give up completely(t__name__t
__module__t__doc__(((s/usr/local/lib/python2.7/bdb.pyR
scBseZdZd,dZdZdZdZdZdZ	dZ
dZd	Zd
Z
dZdZd
ZdZdZdZdZddZdZdZdZdZd,dZdZdZdd,d,dZdZdZdZ dZ!d Z"d!Z#d"Z$d#Z%d$Z&d%Z'd&d'Z(d,d,d(Z)d,d,d)Z*d*Z+d+Z,RS(-sGeneric Python debugger base class.

    This class takes care of details of the trace facility;
    a derived class should implement user interaction.
    The standard debugger class (pdb.Pdb) is an example.
    cCs:|rt|nd|_i|_i|_d|_dS(N(tsettNonetskiptbreakstfncachetframe_returning(tselfR((s/usr/local/lib/python2.7/bdb.pyt__init__s		cCso|d|dd!dkr|S|jj|}|sktjj|}tjj|}||j|<n|S(Nt<iit>(R
tgettostpathtabspathtnormcase(Rtfilenametcanonic((s/usr/local/lib/python2.7/bdb.pyRscCs3ddl}|jd|_|jdddS(Ni(t	linecachet
checkcacheRtbotframet
_set_stopinfo(RR((s/usr/local/lib/python2.7/bdb.pytreset's
	cCs|jr
dS|dkr&|j|S|dkrB|j||S|dkr^|j||S|dkrz|j||S|dkr|jS|dkr|jS|dkr|jSdGt|GH|jS(	Ntlinetcalltreturnt	exceptiontc_calltc_exceptiontc_returns*bdb.Bdb.dispatch: unknown debugging event:(tquittingt
dispatch_linet
dispatch_calltdispatch_returntdispatch_exceptionttrace_dispatchtrepr(Rtframeteventtarg((s/usr/local/lib/python2.7/bdb.pyR(-s$	
cCsG|j|s|j|r@|j||jr@tq@n|jS(N(t	stop_heret
break_heret	user_lineR#RR((RR*((s/usr/local/lib/python2.7/bdb.pyR$As

	cCsm|jdkr"|j|_|jS|j|p=|j|sDdS|j|||jrftn|jS(N(	RRtf_backR(R-tbreak_anywheret	user_callR#R(RR*R,((s/usr/local/lib/python2.7/bdb.pyR%Gs		cCsd|j|s||jkr]z||_|j||Wdd|_X|jr]tq]n|jS(N(R-treturnframeRtuser_returnRR#RR((RR*R,((s/usr/local/lib/python2.7/bdb.pyR&Ts	
	cCs;|j|r4|j|||jr4tq4n|jS(N(R-tuser_exceptionR#RR((RR*R,((s/usr/local/lib/python2.7/bdb.pyR'^s
	cCs.x'|jD]}tj||r
tSq
WtS(N(RtfnmatchtTruetFalse(Rtmodule_nametpattern((s/usr/local/lib/python2.7/bdb.pytis_skipped_modulehscCs|jr(|j|jjdr(tS||jkrZ|jdkrJtS|j|jkSx;|dk	r||jk	r||j	krt
S|j}q]WtS(NRi(RR;t	f_globalsRR8t	stopframet
stoplinenotf_linenoRRR7R0(RR*((s/usr/local/lib/python2.7/bdb.pyR-ns	
cCs|j|jj}||jkr(tS|j}||j|krj|jj}||j|krjtSnt|||\}}|r|j|_	|r|j
r|jt|jnt
StSdS(N(Rtf_codetco_filenameR	R8R?tco_firstlinenot	effectivetnumbert	currentbpt	temporarytdo_cleartstrR7(RR*Rtlinenotbptflag((s/usr/local/lib/python2.7/bdb.pyR.~s	cCs
tddS(Ns)subclass of bdb must implement do_clear()(tNotImplementedError(RR,((s/usr/local/lib/python2.7/bdb.pyRGscCs|j|jj|jkS(N(RR@RAR	(RR*((s/usr/local/lib/python2.7/bdb.pyR1scCsdS(snThis method is called when there is the remote possibility
        that we ever need to stop in this function.N((RR*t
argument_list((s/usr/local/lib/python2.7/bdb.pyR2scCsdS(s9This method is called when we stop or break at this line.N((RR*((s/usr/local/lib/python2.7/bdb.pyR/scCsdS(s5This method is called when a return trap is set here.N((RR*treturn_value((s/usr/local/lib/python2.7/bdb.pyR4scCs|\}}}dS(N((RR*texc_infotexc_typet	exc_valuet
exc_traceback((s/usr/local/lib/python2.7/bdb.pyR5sicCs(||_||_d|_||_dS(Ni(R=R3R#R>(RR=R3R>((s/usr/local/lib/python2.7/bdb.pyRs			cCs|j|||jddS(sxStop when the line with the line no greater than the current one is
        reached or when returning from current frameiN(RR?(RR*((s/usr/local/lib/python2.7/bdb.pyt	set_untilscCsK|jr7|jj}|r7|jr7|j|_q7n|jdddS(sStop after one line of code.N(RR0tf_traceR(RR(Rtcaller_frame((s/usr/local/lib/python2.7/bdb.pytset_steps
	cCs|j|ddS(s2Stop on the next line in or below the given frame.N(RR(RR*((s/usr/local/lib/python2.7/bdb.pytset_nextscCs|j|j|dS(s)Stop when returning from the given frame.N(RR0(RR*((s/usr/local/lib/python2.7/bdb.pyt
set_returnscCsq|dkrtjj}n|jx(|rR|j|_||_|j}q+W|jtj	|jdS(spStart debugging from `frame`.

        If frame is not specified, debugging starts from caller's frame.
        N(
Rtsyst	_getframeR0RR(RTRRVtsettrace(RR*((s/usr/local/lib/python2.7/bdb.pyt	set_traces
		

cCsm|j|jdd|jsitjdtjj}x+|re||jk	re|`|j}q>WndS(Ni(	RRRR	RYR[RZR0RT(RR*((s/usr/local/lib/python2.7/bdb.pytset_continues	
cCs/|j|_d|_d|_tjddS(Ni(RR=RR3R#RYR[(R((s/usr/local/lib/python2.7/bdb.pytset_quits		c
Cs|j|}ddl}|j||}|sAd||fS||jkr`g|j|<n|j|}||kr|j|nt|||||}	dS(NisLine %s:%d does not exist(RRtgetlineR	tappendR(
RRRIRFtcondtfuncnameRRtlistRJ((s/usr/local/lib/python2.7/bdb.pyt	set_breaks
cCsJ||ftjkr,|j|j|n|j|sF|j|=ndS(N(RtbplistR	tremove(RRRI((s/usr/local/lib/python2.7/bdb.pyt
_prune_breaks
s
cCs|j|}||jkr&d|S||j|krGd||fSx&tj||fD]}|jq\W|j||dS(NsThere are no breakpoints in %ssThere is no breakpoint at %s:%d(RR	RRetdeleteMeRg(RRRIRJ((s/usr/local/lib/python2.7/bdb.pytclear_breakscCs{yt|}Wnd|SXytj|}Wntk
rHd|SX|sWd|S|j|j|j|jdS(Ns"Non-numeric breakpoint number (%s)s#Breakpoint number (%d) out of rangesBreakpoint (%d) already deleted(tintRt
bpbynumbert
IndexErrorRhRgtfileR(RR,RDRJ((s/usr/local/lib/python2.7/bdb.pytclear_bpbynumbers	
	
cCsz|j|}||jkr&d|SxC|j|D]4}tj||f}x|D]}|jqTWq4W|j|=dS(NsThere are no breakpoints in %s(RR	RReRh(RRRtblistRJ((s/usr/local/lib/python2.7/bdb.pytclear_all_file_breaks+s
cCsA|js
dSx$tjD]}|r|jqqWi|_dS(NsThere are no breakpoints(R	RRkRh(RRJ((s/usr/local/lib/python2.7/bdb.pytclear_all_breaks5s	cCs/|j|}||jko.||j|kS(N(RR	(RRRI((s/usr/local/lib/python2.7/bdb.pyt	get_break=scCsH|j|}||jkrD||j|krDtj||fpGgS(N(RR	RRe(RRRI((s/usr/local/lib/python2.7/bdb.pyt
get_breaksBscCs1|j|}||jkr)|j|SgSdS(N(RR	(RR((s/usr/local/lib/python2.7/bdb.pytget_file_breaksHscCs|jS(N(R	(R((s/usr/local/lib/python2.7/bdb.pytget_all_breaksOscCsg}|r'|j|kr'|j}nxB|dk	rk|j||jf||jkr_Pn|j}q*W|jtdt	|d}x2|dk	r|j|j|j
f|j}qW|dkrtdt	|d}n||fS(Nii(ttb_framettb_nextRR`R?RR0treversetmaxtlent	tb_lineno(Rtftttstackti((s/usr/local/lib/python2.7/bdb.pyt	get_stackUs 


s: cCs2ddl}ddl}|\}}|j|jj}d||f}|jjrh||jj}n
|d}d|jkr|jd}	nd}	|	r||j|	}n
|d}d|jkr|jd}
|d}||j|
}n|j|||j	}|r.|||j
}n|S(Nis%s(%r)s<lambda>t__args__s()t
__return__s->(RR)RR@RAtco_nametf_localsRR_R<tstrip(Rtframe_linenotlprefixRR)R*RIRtstargstrvR((s/usr/local/lib/python2.7/bdb.pytformat_stack_entryis*



cBs|dkr$ddl}|j}n|dkr9|}n|jej|je|ej	sr|d}nz&y|||UWne
k
rnXWdd|_ejdXdS(Nis
i(Rt__main__t__dict__RRYR[R(t
isinstancettypestCodeTypeRR#(RtcmdtglobalstlocalsR((s/usr/local/lib/python2.7/bdb.pytruns 	


	cCs|dkr$ddl}|j}n|dkr9|}n|jtj|jt|tj	sr|d}nz,yt
|||SWntk
rnXWdd|_tjdXdS(Nis
i(
RRRRRYR[R(RRRtevalRR#(RtexprRRR((s/usr/local/lib/python2.7/bdb.pytrunevals 	


	cCs|j|||dS(N(R(RRRR((s/usr/local/lib/python2.7/bdb.pytrunctxscOsi|jtj|jd}z+y|||}Wntk
rInXWdd|_tjdX|S(Ni(RRYR[R(RRR#(RtfuncRtkwdstres((s/usr/local/lib/python2.7/bdb.pytruncalls

	N(-RRRRR
RRR(R$R%R&R'R;R-R.RGR1R2R/R4R5RRSRVRWRXR\R]R^RdRgRiRnRpRqRrRsRtRuRRRRRR(((s/usr/local/lib/python2.7/bdb.pyRsV	
				
	
	
															
		
		
							cCstjdS(N(RR\(((s/usr/local/lib/python2.7/bdb.pyR\scBs\eZdZdZiZdgZddddZdZdZ	dZ
ddZRS(	sBreakpoint class

    Implements temporary breakpoints, ignore counts, disabling and
    (re)-enabling, and conditionals.

    Breakpoints are indexed by number through bpbynumber and by
    the file,line tuple using bplist.  The former points to a
    single instance of class Breakpoint.  The latter points to a
    list of such instances since there may be more than one
    breakpoint per line.

    iicCs||_d|_||_||_||_||_d|_d|_d|_	t
j|_t
jdt
_|j
j|||f|jkr|j||fj|n|g|j||f<dS(Nii(RbRtfunc_first_executable_lineRmRRFRatenabledtignorethitsRtnextRDRkR`Re(RRmRRFRaRb((s/usr/local/lib/python2.7/bdb.pyR
s									cCsT|j|jf}d|j|j<|j|j||j|sP|j|=ndS(N(RmRRRkRDReRf(Rtindex((s/usr/local/lib/python2.7/bdb.pyRhs

cCs
d|_dS(Ni(R(R((s/usr/local/lib/python2.7/bdb.pytenablescCs
d|_dS(Ni(R(R((s/usr/local/lib/python2.7/bdb.pytdisablescCs|dkrtj}n|jr*d}nd}|jrF|d}n
|d}|d|j||j|jfIJ|jr|d|jfIJn|j	r|d|j	IJn|j
r|j
dkrd	}nd
}|d|j
|fIJndS(Nsdel  skeep syes  sno   s%-4dbreakpoint   %s at %s:%ds	stop only if %ss	ignore next %d hitsiRts!	breakpoint already hit %d time%s(RRYtstdoutRFRRDRmRRaRR(Rtouttdisptss((s/usr/local/lib/python2.7/bdb.pytbpprints(			

				N(RRRRReRRkR
RhRRR(((s/usr/local/lib/python2.7/bdb.pyRs
				cCsn|js#|j|jkrtStS|jj|jkr<tS|jsT|j|_n|j|jkrjtStS(s;Check whether we should break here because of `b.funcname`.(RbRR?R8R7R@RR(tbR*((s/usr/local/lib/python2.7/bdb.pyt
checkfuncnames		cCstj||f}xtdt|D]}||}|jdkrNq)nt||scq)n|jd|_|js|jdkr|jd|_q)q|dfSq)yTt	|j|j
|j}|r|jdkr|jd|_q|dfSnWq)|dfSXq)WdS(sDetermine which breakpoint for this file:line is to be acted upon.

    Called only if we know there is a bpt at this
    location.  Returns breakpoint that was triggered and a flag
    that indicates if it is ok to delete a temporary bp.

    iiN(NN(
RRetrangeRzRRRRaRRR<RR(RmRR*t	possiblesRRtval((s/usr/local/lib/python2.7/bdb.pyRC1s.
	
tTdbcBs,eZdZdZdZdZRS(cCs,|jj}|sd}ndG|G|GHdS(Ns???s+++ call(R@R(RR*Rtname((s/usr/local/lib/python2.7/bdb.pyR2gs	cCs}ddl}|jj}|s'd}n|j|jj}|j||j|j}dG|G|jG|GdG|jGHdS(Nis???s+++t:(	RR@RRRAR_R?R<R(RR*RRtfnR((s/usr/local/lib/python2.7/bdb.pyR/ks	cCs
dG|GHdS(Ns
+++ return((RR*tretval((s/usr/local/lib/python2.7/bdb.pyR4rscCsdG|GH|jdS(Ns
+++ exception(R](RR*t	exc_stuff((s/usr/local/lib/python2.7/bdb.pyR5ts	(RRR2R/R4R5(((s/usr/local/lib/python2.7/bdb.pyRfs			cCs*dG|GdGHt|d}dG|GHdS(Nsfoo(t)i
sbar returned(tbar(tntx((s/usr/local/lib/python2.7/bdb.pytfooxs
cCsdG|GdGH|dS(Nsbar(Ri((ta((s/usr/local/lib/python2.7/bdb.pyR}s
cCst}|jddS(Nsimport bdb; bdb.foo(10)(RR(R}((s/usr/local/lib/python2.7/bdb.pyttests	(RR6RYRRt__all__t	ExceptionRRR\RRRCRRRR(((s/usr/local/lib/python2.7/bdb.pyt<module>s 	T		5		

Zerion Mini Shell 1.0