
    G@d%                     4   d dl Z d dlZe j                            d          rve j        d                             e j                  D ]PZe j        dk    rdev r	 ej                            e	                    e j
                             F# e$ r Y Mw xY wd dlZd dlZd dlmZ d dlZd dlZd dlZde_         ej                    Ze                    ej                   d dlZ	  ej        dej                   n#  Y nxY wd dlmZ d d	lmZmZm Z m!Z! d d
l"m#Z# d dl$m%Z%  e!            rej&        d          gZ' ee'          \  Z(Z)n e            \  Z(Z)e(j*        r
de j        d<   e(j+        re(j+        e j        d<   d Z,d Z-e.dk    r e-             dS dS )    N
PYTHONPATHntpkgsFz
libGL.so.1)mode)get_options)get_conf_pathrunning_in_mac_appreset_config_filesrunning_under_pytest)lockfile)is_text_stringTrueSPYDER_SAFE_MODESPYDER_CONFDIRc                 D   ddl m} |                    dd          }d}t          d          D ]}	 | D ]}t	          j        t          j        t          j        t          j                  }|                    d|f           t          |          r|
                    d          }|                    t          j        |                     |                                 n<# t          j        $ r* |rt!          d	           d
}t#          j        d           Y w xY w dS dS )a
  
    Simple socket client used to send the args passed to the Spyder
    executable to an already running instance.

    Args can be Python scripts or files with these extensions: .spydata, .mat,
    .npy, or .h5, which can be imported by the Variable Explorer.
    r   CONFmainopen_files_portT   z	127.0.0.1zutf-8z`Waiting for the server to open files and directories to be up (perhaps it failed to be started).Fg      ?N)spyder.config.managerr   getrangesocketAF_INETSOCK_STREAMIPPROTO_TCPconnectr   encodesendospabspathcloseerrorprinttimesleep)argsr   portprint_warning__argclients          0lib/python3.11/site-packages/spyder/app/start.pysend_args_to_spyderr/   N   sS    +*****88F-..DM Cjj  	  v~v7I'-'9; ;T2333!#&& .**W--CCK,,--- | 		 		 		 & D E E E % JtH		 	) s   B/C!!6DDc                  \
   t           t          }} | j        rt                       dS ddlm} t          t          j        dd                   t          j	        d<   |
                    dd          rt          |
                    dd                    }t          t          d|                    d	                              }t          |          dk    r|d         t          j	        d
<   n.|t          j	        d<   ndt          j	        d
<   dt          j	        d<   t          j        dk    rdt          j	        d<   t          j	        
                    d          }t          j	        
                    d          }t!          |          rt!          |          s|}n%t!          |          st!          |          r|}ndx}}|t          j	        d<   |t          j	        d<   dt          j	        d<   nR	 ddlm}  |             n@# t&          $ r3 	 dt          j	        d<   dt          j	        d<   n# t(          $ r Y nw xY wY nw xY w| j        rddd}|| j                 t          j	        d<   d}	| j        dk    rt/          j        |	          }
nt3          |	          }
|
t          j	        d<   | j        rddlm} t          j                            d           t?           |                      D ]'}t          j                            d|z   d z              (t          j                            d            dS |
                    dd!          r| j         s| j        stC                      stE          j#        tI          j%        d"d#d$          d%z             t3          d&          }tM          j'        |          }	 |(                                }n#  	 t          j)        d'k    r0t/          j*        |          rddl+}|,                    |d()           n(t/          j-        |          rt          j.        |           n#  Y nxY wdd*l/m0} tc                      r|2                    | |          cY S |2                    | |           Y dS xY w|rBdd*l/m0} tc                      r|2                    | |          S |2                    | |           dS |rtg          |           dS ti          d+           dS dd*l/m0} tc                      r|2                    | |          S |2                    | |           dS ),z
    Start Spyder application.

    If single instance mode is turned on (default behavior) and an instance of
    Spyder is already running, this will just parse and send command line
    options to the application.
    Nr   r      SPYDER_ARGSr   high_dpi_custom_scale_factorhigh_dpi_custom_scale_factors;QT_SCALE_FACTORQT_SCREEN_SCALE_FACTORS darwin1QT_MAC_WANTS_LAYERLANGLC_ALLzen_US.UTF-8EVENT_NOKQUEUE)	getlocaleC23)minimalverboseSPYDER_DEBUGzspyder-debug.logfileSPYDER_DEBUG_FILE)get_conf_pathsz	
config:
	
single_instancei  i  Z   g     @zspyder.lockr   T)ignore_errors)
mainwindowzdSpyder is already running. If you want to open a new 
instance, please use the --new-instance option)5CLI_OPTIONSCLI_ARGSr
   r   r   strsysargvosenvironr   listfiltersplitlenplatformboollocaler?   
ValueError	Exception
debug_infodebug_outputr!   realpathr   pathsspyder.config.baserH   stdoutwritereversednew_instancer	   r&   r'   random	randranger   FilesystemLocklocknameisdirshutilrmtreeislinkunlink
spyder.apprN   r   r   r/   r%   )optionsr(   r   factorsfr<   r=   r?   levels	_filename	_filepathrH   path	lock_filerk   lock_createdrn   rN   s                     r.   r   r   s   s    !(TG ! ****** !$CHQRRL 1 1BJ} xx677 	3dhhv'FGGHHgmmC001122q66Q;;,-aDBJ())4;BJ011(*
$%02
,-
|x+.
'(z~~f%%)):: 	*d6ll 	*FFd 	*V 	*DD))D6!
6%
8
 (+
#$$
		((((((IKKKK 	 	 	%(
6"'*
8$$   	  @ S11%+G,>%?
>""Iv%%L++		!),,	&/BJ"#} 555555
+,,,^^--.. 	1 	1DJTD[4/0000
*++ @+G4H @+.@+&((@+ 	
6#D$33F:;;; "-00	&y11	99;;LL	
	7d??y++ E%itDDDz),, -	),,,
 .-----#%% !w55555... 	H------#%% /!w555.....  H#D))))) G H H H H H 	*)))))!! 	+??7D111OOGT*****sa   ,G= =
H:H'&H:'
H41H:3H44H:9H:4O	 	RA(P54R5P97/R(R__main__)/rT   rR   rU   r   rX   pathsepry   rl   removerstripsepr]   ctypesloggingos.pathr!   rh   r   r&   raiseExceptions	getLoggerroot_loggersetLevelERRORzmqCDLLRTLD_GLOBALspyder.app.cli_optionsr   rc   r   r	   r
   r   spyder.utils.externalr   spyder.py3compatr   rS   sys_argvrO   rP   	safe_modeconf_dirr/   r   __name__     r.   <module>r      s   
			 



:>>, 	
<(..rz::  7d??v~~BF 3 34444                   g!!   W] # # # 


	FK6#566666	D / . . . . .J J J J J J J J J J J J * * * * * * + + + + + +  *}H'K11K'KMMK  ,%+BJ!" 8#.#7BJ " " "J[+ [+ [+| zDFFFFF s   2BBB(D   D