o ?Og@s ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZGdddeZgdZddZddZGd d d eZd ZGd d d ejejZedurgdZeD]Zeeedejd7Zqpeejj7Z[[d)ddZ d)ddZ!ddZ"ddZ#ddddZ$d*ddZ%ddZ&d Z'd!d"Z(d#d$Z)d%Z*d&d'Z+e,d(krddl-Z-e-+dSdS)+Nc@seZdZ dS)RestartN)__name__ __module__ __qualname__rr*/opt/alt/python310/lib64/python3.10/pdb.pyrWsr) runpmPdbrunevalrunctxruncall set_trace post_mortemhelpcCstdt|}zt|}Wn tyYdSw|'t|ddD]\}}||r<|||fWdSq%WddS1sHwYdS)Nzdef\s+%s\s*[(])start)recompileescapetokenizeopenOSError enumeratematch)funcnamefilenameZcrefplinenolinerrr find_function^s"    r cCs8tt|}||D] \}}||kr|Sq dSNr)listdisZfindlinestartsreverse)codeZlastiZ linestartsirrrr lasti2linenoks r'c@seZdZ ddZdS)_rstrcCs|SNrselfrrr__repr__vsz_rstr.__repr__N)rrrr,rrrrr(ts r(z -> c@s(eZdZdZ  dddZddZd d Zd d Zd dZddZ ddZ ddZ ddZ ddZ ddZddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*Zd+d,Zd-d.Zd/d0Zd1d2Zd3d4Zd5d6ZeZdd8d9Zd:d;ZeZ eZ!eZ"dd?Z%d@dAZ&dBdCZ'eZ(dDdEZ)eZ*dFdGZ+eZ,dHdIZ-eZ.dJdKZ/e/Z0eZ1eZ2dLdMZ3e3Z4e3Z5dNdOZ6dPdQZ7e7Z8dRdSZ9e9Z:dTdUZ;e;ZdXdYZ?e?Z@dZd[ZAeAZBd\d]ZCeCZDd^d_ZEeEZFZGd`daZHeHZIdbdcZJeZKdddeZLeLZMeLZNdfdgZOdhdiZPePZQdjdkZReRZSdldmZTddndoZUdpdqZVdrdsZWdtduZXdvdwZYeZZeZ[eZ\dxdyZ]e]Z^dzd{Z_e_Z`d|d}ZaeZbdddZcddZdeZeddZfeZgddZhddZiddZjddZkddZlddZmgdZnddZoepfddZqddZrerZsddZtddZuddZvddZwddZxdS)r NtabFTc Cs\tjj||dtj||||td|rd|_d|_i|_ i|_ d|_ d|_ i|_ z ddl}|dWn tyAYnwd|_||_g|_|rz ttjd}|j|Wdn1sgwYWn tyvYnwztd }|j|Wdn1swYWn tyYnwi|_i|_i|_d|_d|_dS) N)skipzpdb.Pdbrz(Pdb) Fz `@#$%^&*()=+[{]}\|;:'",<>?z~/.pdbrcz.pdbrc)bdbBdb__init__cmdCmdsysauditZ use_rawinputpromptaliases displaying mainpyfile_wait_for_mainpyfile tb_linenoreadlineZset_completer_delims ImportError allow_kbdintnosigintrcLinesrospath expanduserextendrcommandscommands_dopromptcommands_silentcommands_defining commands_bnum) r+ completekeystdinstdoutr.r@Zreadrcr=ZrcFilerrrr2sT      z Pdb.__init__cCs*|jrt|d|||dS)Nz- Program interrupted. (Use 'cont' to resume).)r?KeyboardInterruptmessageset_stepr)r+Zsignumframerrrsigint_handlers  zPdb.sigint_handlercCstj||dSr))r0r1resetforgetr*rrrrSs  z Pdb.resetcCs&d|_g|_d|_d|_|jdSr!)rstackcurindexcurframer<clearr*rrrrTs z Pdb.forgetcCsj||||\|_|_|r#t|jj|j}||j|j<|j }|s|j|jd|_ |j j |_ | Sr!)rTZ get_stackrUrVr'tb_framef_codetb_lastir<tb_nextrWf_localscurframe_locals execRcLines)r+ftbrrrrsetups  z Pdb.setupcCsj|jsdS|j}|g|_|r3|}|r/|ddkr/||r/|jt|7_dS|sdSdS)Nr#T)rAr$popstriponecmdreversed)r+rArrrrr_s   zPdb.execRcLinescCs4 |jrdS||r|d||ddSdS)Nz--Call--)r;Z stop_hererO interaction)r+rQZ argument_listrrr user_calls  z Pdb.user_callcCsN |jr|j||jjks|jdkrdSd|_||r%||ddSdS)NrF)r;r:canonicrZ co_filenamef_lineno bp_commandsrh)r+rQrrr user_lines  z Pdb.user_linecCs t|ddrI|j|jvrI|j}d|_|j}||d|j|D]}||q!||_|j|s:||j|j |j |rC| | dSdS)N currentbpFrr) getattrrorFlastcmdrbrfrHprint_stack_entryrUrVrG_cmdlooprT)r+rQroZ lastcmd_backrrrrrms"      zPdb.bp_commandscCs0 |jrdS||jd<|d||ddS)N __return__z --Return--)r;r]rOrh)r+rQZ return_valuerrr user_returns   zPdb.user_returncCsj |jrdS|\}}}||f|jd<|s|turdnd}|d|t||df|||dS)NZ __exception__z Internal r/z%s%s)r;r] StopIterationrO tracebackformat_exception_onlyrerh)r+rQexc_infoexc_type exc_value exc_tracebackprefixrrruser_exceptions zPdb.user_exceptioncCs< z d|_|d|_WdSty|dYnwq)NTFz--KeyboardInterrupt--)r?cmdlooprNrOr*rrrrs3s z Pdb._cmdloopcCsb|j|j}|r-|D]!\}}||}||ur,||kr,|||<|d|||fq dSdS)Nzdisplay %s: %r [old: %r])r9getrWitems_getval_exceptrO)r+r9exprZoldvalueZnewvaluerrrpreloop@s z Pdb.preloopcCsrtjrz ttjtjWn tyYnwdt_|||r&|dS||j|j | |dSr)) r _previous_sigint_handlersignalSIGINT ValueErrorrbrTrrrUrVrs)r+rQrxrrrrhMs   zPdb.interactioncCs |dur|t|dSdSr))rOrepr)r+objrrr displayhook_szPdb.displayhookcCs|dddkr|dd}|j}|jj}z;t|ddd}tj}tj}tj}z|jt_|jt_|jt_t|||W|t_|t_|t_WdS|t_|t_|t_w| YdS)Nr! zZsingle) r^rW f_globalsrr5rMrLrexec _error_exc)r+rlocalsglobalsr%Z save_stdoutZ save_stdinZsave_displayhookrrrdefaultgs* z Pdb.defaultcCs |s|S|}|d|jvrJ|j|d}d}|ddD]}|dt||}|d7}q!|dd|dd}|}|d|jvs|ddkrq|d}|dkrq||dd}|j ||d| }|S) Nrr%z%* aliasz;;) resplitr8replacestrjoinfindlstripcmdqueueappendrstrip)r+rargsZiiZtmpArgZmarkernextrrrprecmd|s,   z Pdb.precmdcCs |js tj||S||Sr))rIr3r4rfhandle_command_def)r+rrrrrfs z Pdb.onecmdcCs ||\}}}|s dS|dkrd|j|j<dS|dkr"g|_dS|j|j}|r4||d|n||z t|d|}Wn tyN|j}Ynw|j |j vr`d|j |j<g|_dSdS)NZsilentTendrrdo_F) Z parselinerHrJrrFrrpAttributeErrorrrcommands_resumingrG)r+rr3argZcmdlistfuncrrrrs0       zPdb.handle_command_defcCst||jddS)NfileprintrMr+msgrrrrOz Pdb.messagecCstd||jddS)Nz***rrrrrrerrorz Pdb.errorcCs|dr gSz |||||}Wn tyg}Ynwtt|d}|D]$}tj|r;| |dq+tj |rO| drO| |dq+|S)N):,*/).pyz.pywr) reendswith_complete_expression ExceptionglobrrBrCisdirrisfilelower)r+textrbegidxendidxZretglobsfnrrr_complete_locations  zPdb._complete_locationcsfddttjjDS)Ncs.g|]\}}|durt|rt|qSr))r startswith).0r&bprrr s z*Pdb._complete_bpnumber..)rr0 Breakpoint bpbynumberr+rrrrrrr_complete_bpnumberszPdb._complete_bpnumberc s|jsgSi|jj|j}dvrRdz|d}ddD]}t||}q$Wn ttfy:gYSwddddfddt|DSfdd| DS)N.rrrvcs"g|] }|dr|qS)rvrrn)dottedr~rrrs"z,Pdb._complete_expression..cg|] }|r|qSrrrrrrr) rWrr^rrpKeyErrorrrdirkeys)r+rrrrnsrpartr)rr~rrrs    zPdb._complete_expressioncCsD |s ttjjd}nzt|}Wn |dYdS||_||jvr5|j||j||j |f}nd}g|j|<d|j|<d|j |<|j }d|_ d|_ zKz| Wn2t y|ru|d|j|<|d|j|<|d|j |<n |j|=|j|=|j |=|dYn wWd|_ ||_ dSWd|_ ||_ dSd|_ ||_ w) Nrz.Usage: commands [bnum] ... endTFz(com) rrz1command definition aborted, old commands restored)lenr0rrintrrJrFrGrHr7rIrrN)r+rZbnumZold_command_defsZ prompt_backrrr do_commandssR$          zPdb.do_commandsrc Cs. |s|jr|dtjjD] }|r||qdSd}d}d}|d}|dkr>||dd}|d|}| d}d} |dkr|d|}| |} | sa| d|dS| }||dd}zt |}Wnit y| d|YdSwzt |}WnQt yz t||jj|j} Wn|} Yzt| dr| j} | j} | j} | j}| j}Wn||\} }}| s| d |YYdS| } t |}YYnw|s|}|||}|r|||||| }|r| |dS|||d }|d |j|j|jfdSdS) Nz!Num Type Disp Enb Whererrrrz%r not found from sys.pathzBad lineno: %s__func__zJThe specified object %r is not a function or was not found along sys.path.rvzBreakpoint %d at %s:%d) breaksrOr0rrZbpformatrrrrfind lookupmodulerrrevalrWrr^hasattrr__code__co_nameco_firstlinenorklineinfo defaultFile checklineZ set_break get_breaksnumberrr)r+rZ temporaryrrrcondZcommaZcolonrr`rr%okZlnrerrrrrdo_breakNs              z Pdb.do_breakcCs$ |jjj}|dkr|jr|j}|S)Nz)rWrZrkr:)r+rrrrrs  zPdb.defaultFilecCs ||ddSNr)rr+rrrr do_tbreaksz Pdb.do_tbreakc Csd}|d}t|dkr|d}nt|dkr!|d}n|S|dkr)|S|d}|ddkr?|d=t|dkr?|S|}t|dkrN|d}n||d}|rY|}|d}t||} | pe|S) N)NNN'rrr/rr+)rrrerrr ) r+Z identifierZfailedZidstringidpartsZfnameitemr`Zanswerrrrrs,          z Pdb.lineinfocCs t|dd}|r |jnd}t|||}|s|ddS|}|r:|ddks:|dddks:|dddkrA|ddS|S) NrWz End of filerrcrz"""z'''zBlank or comment)rpr linecachegetlinerOrer)r+rrrQrrrrrrs    z Pdb.checklinec Cl |}|D],}z||}Wnty'}z ||WYd}~qd}~ww||d|qdS)Nz Enabled %s)rget_bpbynumberrrenablerOr+rrr&rrrrr do_enablesz Pdb.do_enablec Cr)Nz Disabled %s)rrrrdisablerOrrrr do_disableszPdb.do_disablec Cs |dd}z|d}Wn tyd}Ynwz ||d}Wn&ty3|dYdStyJ}z ||WYd}~dSd}~ww||_|sZ|d|jdS|d|jdS)NrrrBreakpoint number expectedz#Breakpoint %d is now unconditional.z$New condition set for breakpoint %d.) r IndexErrorrrerrrrOr)r+rrrrrrrr do_conditions&    zPdb.do_conditionc Cs |}z t|d}Wnd}Yz ||d}Wn&ty0|dYdStyG}z ||WYd}~dSd}~ww||_|dkrf|dkrXd|}nd}|d||j fdS|d|j dS)Nrrrz %d crossingsz 1 crossingz%Will ignore next %s of breakpoint %d.z-Will stop next time breakpoint %d is reached.) rrrerrrrignorerOr)r+rrcountrrZcountstrrrr do_ignore7s2    z Pdb.do_ignorec Cs |s:ztd}Wn tyd}Ynw|}|dvr8ddtjjD}||D] }|d|q.dSd|vr| d}|d|}||dd}zt |}Wn t ydd |}Ynw| ||dd}| ||}|r~||dS|D] }|d|qdS|} | D]-}z||}Wnt y}z ||WYd}~qd}~ww|||d|qdS) NzClear all breaks? Zno)yZyescSsg|]}|r|qSrr)rrrrrrhsz Pdb.do_clear..z Deleted %srrzInvalid line number (%s))inputEOFErrorrerr0rrZclear_all_breaksrOrrrrZ clear_breakrrrZclear_bpbynumber) r+rZreplyZbplistrr&rrrZ numberlistrrrdo_clearZsT           z Pdb.do_clearcCs |dSr))print_stack_tracerrrrdo_wheres z Pdb.do_wherecCs>||_|j|jd|_|jj|_||j|jd|_dSr!)rVrUrWr]r^rrr)r+rrrr _select_frames   zPdb._select_framecCsz |jdkr |ddSzt|pd}Wnty&|d|YdSw|dkr.d}ntd|j|}||dS)Nrz Oldest framerInvalid frame count (%s))rVrrrmaxrr+rrZnewframerrrdo_ups   z Pdb.do_upcCs |jdt|jkr|ddSzt|pd}Wnty+|d|YdSw|dkr8t|jd}n tt|jd|j|}||dS)Nrz Newest framerr)rVrrUrrrminrrrrrdo_downs  z Pdb.do_downcCsh |r)zt|}Wnty|d|YdSw||jjkr(|ddSnd}||j|dS)NError in argument: %rz7"until" line number is smaller than current line numberr)rrrrWrlZ set_until)r+rrrrrdo_untils    z Pdb.do_untilcCs |dSr)rPrrrrdo_stepsz Pdb.do_stepcC ||jdSr)Zset_nextrWrrrrdo_nexts z Pdb.do_nextc Csx |r:ddl}tjdd}z||t_Wnty2}z|d||fWYd}~dSd}~ww|tjdd<t)NrrzCannot run %s: %s)shlexr5argvrrrr)r+rrZargv0errrdo_runsz Pdb.do_runcCrr)Z set_returnrWrrrr do_returns z Pdb.do_returncCs> |jsz ttj|jt_Wn tyYnw|dSr)r@rrrRr rrZ set_continuerrrr do_continues zPdb.do_continuec Cs |jdt|jkr|ddSzt|}Wnty'|dYdSwz||j_|j|jd|f|j|j<||j|jWdSty`}z|d|WYd}~dSd}~ww)Nrz)You can only jump within the bottom framez)The 'jump' command requires a line numberrzJump failed: %s) rVrrUrrrrWrlrr)r+rrrrrdo_jump!s"   z Pdb.do_jumpcCs td|jj}|j}t|j|j|j}d|j |_ | dz t |j |||fWn ty<|Ynw| dt|j|j|_dS)Nz(%s) zENTERING RECURSIVE DEBUGGERzLEAVING RECURSIVE DEBUGGER)r5settracerWrr^r rKrLrMr7rerO call_tracingrrrZtrace_dispatchrq)r+rrrprrrdo_debug>s       z Pdb.do_debugcCs d|_|dS)NTr)_user_requested_quitset_quitrrrrdo_quitTsz Pdb.do_quitcCs |dd|_|dS)Nr/Tr)rOr%r&rrrrdo_EOF_s  z Pdb.do_EOFcCs |jj}|j}|j|j}|jtj@r|d}|jtj@r"|d}t |D]}|j |}||vr=| d|||fq&| d|fq&dS)Nrz%s = %rz%s = *** undefined ***) rWrZr^ co_argcountco_kwonlyargcountco_flagsinspectZ CO_VARARGSZCO_VARKEYWORDSrange co_varnamesrO)r+rcodictrr&namerrrdo_argshs   z Pdb.do_argscCs2 d|jvr|t|jddS|ddS)NrtzNot yet returned!)r^rOrrrrrr do_retvalys z Pdb.do_retvalcCs&z t||jj|jWS|r))rrWrr^rrrrr_getvals z Pdb._getvalcCshz|durt||jj|jWSt||j|jWStdd}tj|d }t d|YS)Nrrvz** raised %s **) rrWrr^r]r5rzrxryrer()r+rrQrzrrrrrszPdb._getval_exceptcCs,tdd}|tj|ddS)Nrrv)r5rzrrxryre)r+rzrrrrszPdb._error_exccCsFz||}WnYdSz |||WdS|YdSr))r4rOr)r+rrvalrrr _msg_val_funcszPdb._msg_val_funccCs ||tdSr))r6rrrrrdo_pszPdb.do_pcCs ||tjdSr))r6pprintZpformatrrrrdo_ppsz Pdb.do_ppcCs d|_d}|rM|dkrMz/d|vr-|d\}}t|}t|}||kr,||}n t|}td|d}Wn)tyL|d|YdSw|jdusV|dkr`td|jj d}n|jd}|durm|d}|jj j }| dr|jj d }t|tr|}||}z0t||jj }|||d||||jt|t||_t||kr|d WdSWdStyYdSw) Nr"rrrr zr,getsourcelinesrrr@)r+rrrCrDrrrrr do_longlists   zPdb.do_longlistc Csv z||}WnYdSz t|\}}Wnttfy2}z ||WYd}~dSd}~ww|||dSr))r4r,rFr TypeErrorrr@)r+rrrDrrrrr do_sources z Pdb.do_sourcerc Cs |r|j}|j|d}nd}}t||D]>\}}t|d} t| dkr,| d7} ||vr5| d7} n| d7} ||krB| d7} n||krJ| d7} || d|qdS) NrvrrBz->z>> ) rlr<rrrrjustrrOr) r+rDrrrQZcurrent_linenoZ exc_linenorrsrrrr@ s$   zPdb._print_linescCs z||}WnYdSd}z|jj}Wn ty Ynw|r-|d|jdSz|j}Wn ty;Ynw|rH|d|jdS|jturZ|d|j|j fdS|t|dS)Nz Method %sz Function %sz Class %s.%s) r4rrrrOr __class__typerr)r+rvaluer%rrr do_whatis s4     z Pdb.do_whatiscCsp |s|d|j|jiD] }|d|qdS||}||j|ji|<|d||fdS)NzCurrently displaying:z%s: %rzdisplay %s: %r)rOr9rrWrr setdefault)r+rrr5rrr do_displayCs  zPdb.do_displaycCsV |r!z |j|ji|=WdSty |d|YdSw|j|jddS)Nznot displaying %s)r9rrWrrrdrrrr do_undisplayVs zPdb.do_undisplaycsfdd|j|jiDS)Ncrrr)rrrrrrfs z*Pdb.complete_undisplay..)r9rrWrrrrcomplete_undisplayeszPdb.complete_undisplaycCs& i|jj|j}tjd|ddS)Nz *interactive*)Zlocal)rWrr^r%interact)r+rrrrr do_interactiszPdb.do_interactcCs |}t|dkr%t|j}|D]}|d||j|fqdS|d|jvrDt|dkrD|d|d|j|dfdSd|dd|j|d<dS)Nrz%s = %srr)rrsortedr8rrOr)r+rrrrrrrdo_aliasrs $ z Pdb.do_aliascCs< |}t|dkr dS|d|jvr|j|d=dSdSr!)rrr8)r+rrrrr do_unaliass zPdb.do_unaliascsfdd|jDS)Ncrrr)rarrrrrz(Pdb.complete_unalias..)r8rrrrcomplete_unaliasrzPdb.complete_unalias)rrrrr'r cCs2z|jD]}||qWdStyYdSwr))rUrrrN)r+ frame_linenorrrr s   zPdb.print_stack_tracecCs6|\}}||jur d}nd}|||||dS)Nz> z )rWrOZformat_stack_entry)r+r^Z prompt_prefixrQrr~rrrrrs   zPdb.print_stack_entrycCs |s tj||Szz t|d|}|WWSty't|d|}YnwWnty:|d|YdSwtjjdkrJ|d|dS|j durX|d|dS| |j dS)NZhelp_rzNo help for %rrzJNo help for %r; please do not run Python with -OO if you need command helpz&No help for %r; __doc__ string missing) r3r4do_helprprrr5flagsoptimize__doc__rOr)r+rZtopicZcommandrrrr_s.     z Pdb.do_helpcCs ||jjpddS)Nr/)rO help_execrbrer*rrrrcs z Pdb.help_execcCs tdSr))rr*rrrhelp_pdbs z Pdb.help_pdbcCs tj|rtj|r|Stjtjd|}tj|r)|||jkr)|Stj|\}}|dkr9|d}tj|rA|StjD]$}tj |rWt |}tj |sLtj||}tj|rh|SqDdS)Nrr/r) rBrCisabsexistsrr5rjr:splitextislinkreadlink)r+rr`rootZextdirnamefullnamerrrrs(      zPdb.lookupmodulec Csrd|_d|_ddl}||\}}}||j|_ddl}|j |j d|j|j |j |t d||dS)NTFr__main__)rr< __package__ __loader____spec__ __builtins__)r;r%runpy_get_module_detailsrjrkr:rm__dict__rXupdateparentloaderrqr)r+Z module_namerrZmod_nameZmod_specr%rmrrr _runmodules  zPdb._runmodulecCsddl}|j|jd|tdd|_|||_d|_t |}d| |jf}Wdn1s8wY| |dS)Nrrm)rr<rqTFzexec(compile(%r, %r, 'exec'))) rmrtrXrurqr;rjr:r%io open_codereadr)r+rrmr statementrrr _runscripts    zPdb._runscript)r-NNNFT)rr))rN)yrrrrr2rRrSrTrbr_rirnrmrurrsrrhrrrrfrrOrrrrrZcomplete_commandsrrZdo_bZcomplete_breakZ complete_brZcomplete_tbreakrrrZcomplete_enablerZcomplete_disablerZcomplete_conditionrZcomplete_ignorer Zdo_clZcomplete_clearZ complete_clr Zdo_wZdo_btrrZdo_urZdo_drZdo_untrZdo_srZdo_nrZ do_restartrZdo_rrZdo_cZdo_contr Zdo_jr$Zcomplete_debugr'Zdo_qZdo_exitr(r2Zdo_ar3Zdo_rvr4rrr6r7r9Zcomplete_printZ complete_pZ complete_pprEZdo_lrGZdo_llrIZcomplete_sourcer@rRZcomplete_whatisrTZcomplete_displayrUrVrXrZr[r]rr  line_prefixrrr_Zdo_hrcrdrrxr}rrrrr s /     M ]!!.    7  ! #     r )"rwhereZdownZupbreakZtbreakrXrrrZ conditionrFsteprZuntilZjumpreturnZretvalrcontinuer"Zlonglistrr#ZppZwhatissourceZdisplayZ undisplayrWrZunaliasdebugquitrz cCst|||dSr))r rr|rrrrrrFrrcCst|||Sr))r r )Z expressionrrrrrr Isr cCst|||dSr))rrrrrr Lsr cOstj|i|Sr))r r )rkwdsrrrr Prr )headercCs,t}|dur |||tjdSr))r rOrr5 _getframef_back)rpdbrrrrSs rcCsB|dur td}|durtdt}||d|dS)NrzAA valid traceback must be passed if no exception is being handled)r5rzrr rSrh)tr#rrrr[s rcCsttjdSr))rr5last_tracebackrrrrr isr zimport x; x.main()cCs ttdSr))rTESTCMDrrrrtestqs rcCsddl}|tdSr!)pydocZpagerrb)rrrrrusrausage: pdb.py [-c command] ... [-m module | pyfile] [arg] ... Debug the Python program given by pyfile. Alternatively, an executable module or package to debug can be specified using the -m switch. Initial commands are read from .pdbrc files in your home directory and in the current directory, if they exist. Commands supplied with -c are executed after commands from .pdbrc files. To let the script run until an exception occurs, use "-c continue". To let the script run up to a given line X in the debugged file, use "-c 'until X'".c CsDddl}|tjdddddg\}}|stttdg}d}|D]!\}}|dvr6tttq%|d vr@||q%|d vrFd }q%|d}|s^tj |s^td |d td|r~ddl }z| |Wnt y}t tdYnw|tjdd<|stj|}tj|tjd<t} | j| z|r| |n| || jrWdStdWngtytd|dtddtjddYnKtytdddttdYn5tyt tdYn$t tdtdtd} | d| td|dYq)Nrrzmhc:rzcommand=rF)z-hz--help)z-cz --command)z-mTzError:zdoes not existz*The program finished and will be restartedZ Restartingzwith arguments:rLrz/The program exited via sys.exit(). Exit status:)rz2Uncaught exception. Entering post mortem debuggingz1Running 'cont' or 'step' will restart the programz#Post mortem debugger finished. The z will be restarted)getoptr5rr_usageexitrrBrCrfrrrsrrx print_excrealpathrkr rArErxr}r%rr SystemExitrz SyntaxErrorrh) rZoptsrrFZ run_as_moduleoptZoptargr:rrrrrrrmainsz                     rrm)NNr)).rBryrr5r3r0r#r%rr8rr,rrxrrr__all__r r'rr(r~r1r4r rbZ _help_orderZ_commandrprercrr r r rrr rrrrrrrrrrrspC   =    L