
    ^h*                     :   S SK Jr  S SKrS SKrS SKJr  SrS SKJr  S SK	J
r
  S SKJr  S SKJr   S SKrS	 rS/ 4S
 jrS rSS jrS r " S S\5      rS rSS jrS rSS jrS rSS jr\S 5       r\" 5       rS\-  r S r!\"S:X  a  \!" 5         gg!   S SKr Nf= f)    )print_functionN)contextmanagerz0.13.13)get_ipython)BdbQuit_excepthook)TerminalIPythonApp)InteractiveShellEmbedc                     [        5       n U c;  [        5       nSUl        UR                  S/5        UR                  n U R                  $ [        U [        5      (       a  [        R                  R                  S5        U R                  $ )NFz--no-term-titlezZ
You are currently into an embedded ipython shell,
the configuration will not be loaded.

)r   r   interact
initializeshell
isinstancer   sysstderrwritedebugger_cls)r   ipapps     G/home/james-whalen/.local/lib/python3.13/site-packages/ipdb/__main__.py_get_debugger_clsr      s}    ME} #$+,-  e233JJ<     c                     U c  [         R                  " S[        5       5      n [        5       n U" U S9nUR
                  R                  U5        U$ ! [         a
    U" 5       n N0f = f)NIPDB_CONTEXT_SIZE)context)osgetenvget_context_from_configr   	TypeErrorrcLinesextend)r   commandsr   ps       r   	_init_pdbr!   3   sd    ))/1H1JK$&L) IIXH  Ns   A A%$A%c                      [         R                  [        :w  a)  [         R                  [        l        [        [         l        g g N)r   
excepthookr   excepthook_ori r   r   wrap_sys_excepthookr'   ?   s*     ~~++,/NN)+ ,r   c                    U(       d  g [        5         U c  [        R                  " 5       R                  n [	        U5      R                  U 5      nU(       a-  [        US5      (       a  UR                  R                  5         g g g )Nr   )	r'   r   	_getframef_backr!   	set_tracehasattrr   restore_sys_module_state)framer   condr    s       r   r+   r+   G   s_    }&&'$$U+AWQ  	((* !qr   c                     [        5       n  U R                  SS5      $ ! [        R                  [        R                  4 a     g[
         a1    U R                  SS5      n[        SU R                  < SU< S35      ef = f)Nipdbr      zIn z,  context value [z&] cannot be converted into an integer.)
get_configgetintconfigparserNoSectionErrorNoOptionError
ValueErrorgetfilepath)parservalues     r   r   r   R   su    \F	
}}VY//'')C)CD  


69-'
 	

s    $A>:A>c                   6    \ rS rSrSrS rS rS rS rS r	Sr
g	)

ConfigFile`   z
Filehandle wrapper that adds a "[ipdb]" section to the start of a config
file so that users don't actually have to manually add a [ipdb] section.
Works with configparser versions from both Python 2 and 3
c                     SU l         [        U5       nUR                  5       U l        S S S 5        g ! , (       d  f       g = f)NT)firstopen	readlineslines)selfr:   fs      r   __init__ConfigFile.__init__g   s)    
(^qDJ ^^s	   2
A c                 D     U R                  5       $ ! [         a     gf = f)N )__next__StopIterationrE   s    r   readlineConfigFile.readlinem   s%    	==?" 		s    
c                 "    U R                  5       $ r#   )rK   rM   s    r   nextConfigFile.nextt   s    }}r   c                     U $ r#   r&   rM   s    r   __iter__ConfigFile.__iter__x   s    r   c                     U R                   (       a  SU l         gU R                  (       a  U R                  R                  S5      $ [        e)NFz[ipdb]
r   )rA   rD   poprL   rM   s    r   rK   ConfigFile.__next__{   s3    ::DJ::::>>!$$r   )rA   rD   N)__name__
__module____qualname____firstlineno____doc__rG   rN   rQ   rT   rK   __static_attributes__r&   r   r   r>   r>   `   s     'r   r>   c            
         [         R                  " 5       n / nS Hm  n[        R                  R	                  [        R
                  " 5       U5      n[        R                  R                  U5      (       d  M\  UR                  U5        Mo     [        R                  " S5      nU(       aU  [        R                  R	                  US5      n[        R                  R                  U5      (       a  UR                  U5        [        R                  " S5      nU(       a5  [        R                  R                  U5      (       a  UR                  U5        U(       Ga*   U R                  nU GH  nXl        UR                  S5      (       a/  [        U5       n	U R                  S5        U" U	5        SSS5        MO  UR                  S5      (       a   S	SKn
S
n[        X5       n	U
R)                  U	5      nSU;   ak  SUS   ;   ab  U R+                  S5      (       d  U R-                  S5        US   S   R/                  5        H!  u  pU R1                  SU[3        U5      5        M#     SSS5        GM  U" [5        U5      5        GM     U $ ! [         a    U R                  n GN8f = f! , (       d  f       GMJ  = f! ["         a"     S	SKn
S
n N! ["         a    S	SKn
Sn  GNf = ff = f! , (       d  f       GM  = f)a  
Get ipdb config file settings.
All available config files are read.  If settings are in multiple configs,
the last value encountered wins.  Values specified on the command-line take
precedence over all config file settings.
Returns: A ConfigParser object.
)	setup.cfg.ipdbpyproject.tomlHOMEra   IPDB_CONFIGr`   r1   Nrb   r   rbrtool)r5   ConfigParserr   pathjoingetcwdisfileappendr   	read_fileAttributeErrorreadfpr:   endswithrB   remove_sectiontomllibImportErrortomlitomlloadhas_sectionadd_sectionitemssetstrr>   )r;   	filepathscfg_filecwd_filepathhomedefault_filepathenv_filepath	read_funcr:   rF   rs   	file_mode	toml_filekeyr<   s                  r   r3   r3      sV    &&(FI =ww||BIIK:77>>,''\* = 99VD77<<g677>>*++-. 99]+L|44&	&((I "H&O   --(^q))&1aL $^ ""#344	(" $I (.! 'QI*v69J/J%11&99"..v6*3F*;F*C*I*I*KJC"JJvsCJ? +L /. *X./9 ": M?  	&I	& $^ # ((/$(	& (.$'	(	( /.sU   J J J3BK"JJ 
J0	3
K>KKKKK"
K2	c                     [        5         [        5       nUR                  5         U c  [        R                  " 5       S   n U (       a  UR                  S U 5        g g )N   )r'   r!   resetr   exc_infointeraction)tbr    s     r   post_mortemr      sE    AGGI	z \\^A		dB 
r   c                  6    [        [        R                  5        g r#   )r   r   last_tracebackr&   r   r   pmr      s    ""#r   c                 8    [        5       R                  XU5        g r#   )r!   run)	statementglobalslocalss      r   r   r      s    KOOI/r   c                  6    [        5       R                  " U 0 UD6$ r#   )r!   runcall)argskwargss     r   r   r      s    ;///r   c                 6    [        5       R                  XU5      $ r#   )r!   runeval)
expressionr   r   s      r   r   r      s    ;zF;;r   c               #      #     S v   g ! [          aL    [        R                  " 5       u  pn[        UR	                  5       [        R
                  S9  [        U5         NVf = f! f = f7f)N)file)	Exceptionr   r   print__repr__r   r   )emr   s      r   launch_ipdb_on_exceptionr      sR      	  <<>bajjl,B
 	s2   A'	 A'AAA" AA" "A$$A'a  usage: python -m ipdb [-m] [-c command] ... pyfile [arg] ...

Debug the Python program given by pyfile.

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'"

Option -m is available only in Python 3.7 and later.

ipdb version %s.c            	      N   SS K n SS KnSS Kn SSKJn  UR                  S:  a%  UR                  UR                  SS  SSS	/5      u  pEO$UR                  UR                  SS  S
SS	/5      u  pE/ nSnU HP  u  pUS;   a"  [        [        5        UR                  " 5         M-  US;   a  UR                  U	5        MF  US;   d  MN  SnMR     U(       d!  [        [        5        UR                  " S5        US   n
U(       dC  [        R                  R                  U
5      (       d  [        SU
S5        UR                  " S5        XQl        U(       d,  [        R                  R!                  U
5      UR                  S'   [#        US9n  SS Kn[%        UR&                  S5      (       aI  U(       a!  UR)                  UR+                  U
5      5        OKUR)                  UR-                  U
5      5        O*U(       a  UR/                  U
5        OUR1                  U
5        UR2                  (       a  g [        S5        M  ! [
         a     " S S[        5      n GN;f = f! U a:    [        SU
S5        [        SSR5                  UR                  SS  5      -   5         Na[6         a*    [        SSS9  [        UR8                  " 5       S   5         N  U R;                  5         [        S5        [        S5        UR8                  " 5       S   nUR=                  S U5        [        SU
-   S -   5         N= f)!Nr   )Restartc                       \ rS rSrSrg)main.<locals>.Restarti  r&   N)rY   rZ   r[   r\   r^   r&   r   r   r   r     s    r   r   )r2         zmhc:helpzcommand=zhc:F)z-hz--help)z-cz	--command)z-mTr   zError:zdoes not exist)r   _runz*The program finished and will be restarted
Restartingzwith arguments:	 z0The program exited via sys.exit(). Exit status: rJ   )endz2Uncaught exception. Entering post mortem debuggingz1Running 'cont' or 'step' will restart the programz#Post mortem debugger finished. The z will be restarted)	tracebackr   getoptpdbr   rt   r   version_infoargvr   _usageexitrm   r   ri   existsdirnamer!   r,   Pdbr   _ModuleTarget_ScriptTarget
_runmodule
_runscript_user_requested_quitrj   
SystemExitr   	print_excr   )r   r   r   r   optsr   r   run_as_moduleoptoptarg
mainpyfiler   
stdlib_pdbts                 r   mainr     s   
 6!]]388AB<&*9MN
d]]388AB<8LM
HM""&MHHJ''OOF#F] M  faJ
!;!;h
$45H ggooj1 X
&C
	($z~~v.. HHZ55jABHHZ55jAB NN:.NN:.''>?! Q  	i 	r  	1,
,=>$#((12,//0 	%D"M#,,.#$	(!FGEFq!AOOD!$7*D&' (s1   H3 B#I &I 3II=L$0L$AL$__main__)NNTr#   )NN)#
__future__r   r   r   	decoratorr   __version__IPythonr   IPython.core.debuggerr   IPython.terminal.ipappr   IPython.terminal.embedr   r5   rh   r   r!   r'   r+   r   objectr>   r3   r   r   r   r   r   r   iexr   r   rY   r&   r   r   <module>r      s    & 	 
 $  4 5 8(
4 R 	,+
! !HBJ	 $00<    
 "
"$N(b zF G
('s   B B