Qf}Z^dZddlZddlZddlZddlZddlZddlZejejga da da da dZ dZdZdZdZdZdd Zd Zd Zd Zd ZdZdZddZddZdZdZdZdZdZ dZ!dZ"dZ#ejHjJse#dZ&e'dk(re&yy)a Append module search paths for third-party packages to sys.path. **************************************************************** * This module is automatically imported during initialization. * **************************************************************** This will append site-specific paths to the module search path. On Unix (including Mac OSX), it starts with sys.prefix and sys.exec_prefix (if different) and appends lib/python/site-packages. On other platforms (such as Windows), it tries each of the prefixes directly, as well as with lib/site-packages appended. The resulting directories, if they exist, are appended to sys.path, and also inspected for path configuration files. If a file named "pyvenv.cfg" exists one directory above sys.executable, sys.prefix and sys.exec_prefix are set to that directory and it is also checked for site-packages (sys.base_prefix and sys.base_exec_prefix will always be the "real" prefixes of the Python installation). If "pyvenv.cfg" (a bootstrap configuration file) contains the key "include-system-site-packages" set to anything other than "false" (case-insensitive), the system-level prefixes will still also be searched for site-packages; otherwise they won't. All of the resulting site-specific directories, if they exist, are appended to sys.path, and also inspected for path configuration files. A path configuration file is a file whose name has the form .pth; its contents are additional directories (one per line) to be added to sys.path. Non-existing directories (or non-directories) are never added to sys.path; no directory is added to sys.path more than once. Blank lines and lines beginning with '#' are skipped. Lines starting with 'import' are executed. For example, suppose sys.prefix and sys.exec_prefix are set to /usr/local and there is a directory /usr/local/lib/python2.5/site-packages with three subdirectories, foo, bar and spam, and two path configuration files, foo.pth and bar.pth. Assume foo.pth contains the following: # foo package configuration foo bar bletch and bar.pth contains: # bar package configuration bar Then the following directories are added to sys.path, in this order: /usr/local/lib/python2.5/site-packages/bar /usr/local/lib/python2.5/site-packages/foo Note that bletch is omitted because it doesn't exist; bar precedes foo because bar.pth comes alphabetically before foo.pth; and spam is omitted because it is not mentioned in either path configuration file. The readline module is also automatically configured to enable completion for systems that support it. This can be overridden in sitecustomize, usercustomize or PYTHONSTARTUP. Starting Python in isolated mode (-I) disables automatic readline configuration. After these operations, an attempt is made to import a module named sitecustomize, which can perform arbitrary additional site-specific customizations. If this import fails with an ImportError exception, it is silently ignored. Ncptjjrt|tjyy)Nfile)sysflagsverboseprintstderr)messages +/opt/alt/python312/lib64/python3.12/site.py_tracer \s" yy gCJJ'ctjj|} tjj|}|tjj |fS#t$rY,wxYwN)ospathjoinabspathOSErrornormcase)pathsdirs r makepathras[ '',, C ggooc"   % %%    sA A*)A*c<ttjjD]~}d} |jj }|dvr! tjj|j|_ tjj|j|_y#t $r4 |jjj }n#t $rYnwxYwYwxYw#t ttf$rYwxYw#t ttf$rYwxYw)zESet all module __file__ and __cached__ attributes to an absolute pathN>_frozen_importlib_frozen_importlib_external)setrmodulesvalues __loader__ __module__AttributeError__spec__loaderrrr__file__r TypeError __cached__)m loader_modules r abs_pathsr*js ##% &  LL33M  S S  4AJ 77??1<<8AL!'   ! 1 1 < < !   3   3   sYB* .C*9.D* C'4 CC' C!C' C!!C'&C'*DDDDcg}t}tjD]7}t|\}}||vs|j ||j |9|tjdd|S)zK Remove duplicate entries from sys.path along with making them absoluteN)rrrrappendadd)L known_pathsrdircases r removeduppathsr1sa A%Kxx } W + % HHSM OOG $CHHQK rct}tjD]A} tjj |rt |\}}|j |C|S#t$rYQwxYw)zEReturn a set containing all existing file system items from sys.path.)rrrrexistsrr-r&)ditem_itemcases r _init_pathinfor8s` A ww~~d#&tn 8h  H   s>A!! A-,A-c | t}d}nd}tjj||} tj|}t |ddtjzst |ddtjzrtd|ytd| tj|5}|j}ddd jd }t%|j'd D]\} } | j)d r| j+dk(r, | j)dr t-| J| j/} t1|| \} } | |vrOtjj3| r0t4jj7| |j9| |rd}|S#t $rYywxYw#1swY xYw#t $rYywxYw#t$rFddl}j|j#}td |d |j#YWwxYw#t:$r} t=d| dd|dt4j>ddl }|jC| D]5}|j'D] } t=d| zt4j>"7t=dt4j>Yd} ~ d} ~ wwxYw)zProcess a .pth file within the site-packages directory: For each line in the file, either combine it with sitedir to a path and add that to known_paths, or execute it if it starts with 'import '. NTFst_flagsrst_file_attributeszSkipping hidden .pth file: zProcessing .pth file: z utf-8-sigz Cannot read z# as UTF-8. Using fallback encoding #)zimport zimport zError processing line r4z of z: rz z Remainder of file ignored)"r8rrrlstatrgetattrstat UF_HIDDENFILE_ATTRIBUTE_HIDDENr io open_codereaddecodeUnicodeDecodeErrorlocale getencoding enumerate splitlines startswithstripexecrstriprr3rr,r- Exceptionr r tracebackformat_exception)sitedirnamer/resetfullnamestf pth_contentrInlinerr0excrRrecords r addpackager_s $& ww||GT*H XXh  Z #dnn 4 )1 -0J0J J,XL9: #H< 01 \\( #q&&(K$ D"((5 [335q94 ??3   ::<2   67T ;;=D#GT2LCk)bggnnS.A$(:.  e $ #  D !((););)=> h\***0*<*<*>)AC D D,  *1Q%tH:SAzz # #44S9"--/D$t)#**50: /cjj A  snG"G7GGG+)H=A2H= G  G GG G('G(+A H:9H:= KB KKctd|| t}d}nd}t|\}}||vr0tjj ||j | tj|}|Dcgc]&}|jdr|jds|(}}t|D]}t||||rd}|S#t$rYywxYwcc}w)zTAdd 'sitedir' argument to sys.path if missing and handle .pth files in 'sitedir'zAdding directory: NTFz.pth.)r r8rrrr,r-rlistdirrendswithrMsortedr_)rTr/rV sitedircasenamesrUs r addsitedirrgs { +,$& #G,G[ + %   $ 7#$ Ded f%dooc.BeE Du 7D+.    Ds#C <+C CCcbtjjryttdr:ttdr*t j t j k7ryttdr:ttdr*t jt jk7ryy)a,Check if user site directory is safe for inclusion The function tests for the command line flag (including environment var), process uid/gid equal to effective uid/gid. None: Disabled for security reasons False: Disabled by user (command line option) True: Safe and enabled FgetuidgeteuidNgetgidgetegidT) rr no_user_sitehasattrrrjrirlrkrr check_enableusersiterpsk yyr8Y!7 ::<299; &r8Y!7 ::<299; & rc tjjdd}|r|Stjdvryd}tj dk(r,tjjdxsd}||dStjdk(r=tj r-|dd tj d tjdd zS|dd S) NPYTHONUSERBASE>wasivxworks emscriptencttjjtjj|Sr)rr expanduserr)argss r joinuserz_getuserbase..joinuser&s$ww!!"'',,"566rntAPPDATA~PythondarwinLibraryz%d.%dz.local)renvirongetrplatformrU _framework version_info)env_baserybases r _getuserbaserszz~~.5H ||887 ww$zz~~i(/Ch'' ||xCNNY#"2"22A"668 8 C ""rc tj}tjdk(r(tjj dd}|d|dStj dk(rtjr|dS|d|d d|d d S) Nrzrar>z\Pythonz\site-packagesr~z/lib/python/site-packagesz /lib/pythonrr<z/site-packages)rrrrUwinverreplacerr)userbaseversion ver_nodots r _get_pathr5sG ww$JJ&&sB/ 8I;o>> ||xCNN455Z{71:,a |> JJrc.t tatS)zReturns the `user base` directory path. The `user base` directory can be used to store data. If the global variable ``USER_BASE`` is not initialized yet, this function will also set it. ) USER_BASErrorr getuserbaserBs N rcXt}t|datSt|atS)zReturns the user-specific site-packages directory path. If the global variable ``USER_SITE`` is not initialized yet, this function will also set it. F)r USER_SITEENABLE_USER_SITEr)rs r getusersitepackagesrOs7}H  $  "(+I rctdt}tr+tjj |r t |||S)zAdd a per user site-package to sys.path Each user has its own python directory with site-packages in the home directory. zProcessing user site-packages)r rrrrisdirrg)r/ user_sites r addusersitepackagesr`s7 *+#%IBGGMM)49k* rc g}t}|t}|D]}|r||vr |j|tjdk(rt j g}t j dk7r|jd|D]I}tjj||dt jddzd}|j|K|j||jtjj|dd|S)aReturns a list containing all global site-packages directories. For each directory present in ``prefixes`` (or the global ``PREFIXES``), this function will find its `site-packages` subdirectory depending on the system environment, and will return a list of full paths. N/libz python%d.%drz site-packagesLib) rPREFIXESr-rsepr platlibdirr,rrr)prefixes sitepackagesseenprefixlibdirslibdirrs r getsitepackagesrosL 5D4   66S=~~&G~~&u%!ww||FF$1C4D4DRa4H$H$35##D) "    '    VUO L M#$ rctdt|D].}tjj |s#t ||0|S)zAdd site-packages to sys.pathzProcessing global site-packages)r rrrrrg)r/rrTs r addsitepackagesrs< ,-"8, 77== ! w ,- rctjdk(rd}nd}tjd|t_tjd|t_y)zDefine new builtins 'quit' and 'exit'. These are objects which make the interpreter exit when called. The repr of each object contains a hint at how it works. \zCtrl-Z plus ReturnzCtrl-D (i.e. EOF)quitexitN)rr _sitebuiltinsQuitterbuiltinsrr)eofs r setquitrsA vv~"!!))&#6HM!))&#6HMrcLtjdtjt_tjddt_gg}}t tdd}|s=ttdr-tjjtj}|ra|jddg|jtjj|tj|tjgtjd d ||t_y) z)Set 'copyright' and 'credits' in builtins copyrightcreditsz Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands for supporting Python development. See www.python.org for more information. _stdlib_dirNr%z LICENSE.txtLICENSElicensez'See https://www.python.org/psf/license/)r_Printerrrrrr@rnrrdirnamer%extendrpardircurdirr)filesdirsheres r setcopyrightrs&// S]]KH$--i:TUHb4E 3 t ,D GB +wwr{{+  mY/0 RWW\\$ 2D"))DE$--1 tHrc>tjt_yr)r_Helperrhelprorr sethelperrs!))+HMrc d}|t_y)ajEnable default readline configuration on interactive prompts, by registering a sys.__interactivehook__. If the readline module can be imported, the hook will set the Tab key as completion key and register ~/.python_history as history file. This can be overridden in the sitecustomize or usercustomize module, or in a PYTHONSTARTUP file. cddl} ddlddl}t dd}|d|vrj dnj d j jdk(rgtjjtjjdd jfd }|j|yy#t$rYywxYw#t$rYwxYw#t$rYBwxYw) Nr__doc__r>libeditzbind ^I rl_completez tab: completer|z.python_historycH jy#t$rYywxYwr)write_history_filer)historyreadlinesr write_historyzCenablerlcompleter..register_readline..write_historys*//8s  !!)atexitr rlcompleter ImportErrorr@parse_and_bindread_init_filerget_current_history_lengthrrrrwread_history_fileregister)rr readline_docrrrs @@r register_readlinez,enablerlcompleter..register_readlines    xB7  # \(A  # #$9 :  # #O 4   # # %  . . 0A 5 ggll277#5#5c#:#46G **73  OOM *+ 6)       "  s5CC!(C0 CC! C-,C-0 C<;C<N)r__interactivehook__)rs r enablerlcompleterrs.+`0CrcBtj}tjdk(r#d|vrtjdx}t_ntj }tj jtj j|}tj j|}dt_ d}tdtj j||tj j||fDd}|r|}d}t|d5} | D]q} d| vs| jd\} } } | jj} | j} | d k(r| j}a| d k(sg| t_ s ddd|xt_t_t%|tj g|dk(r&t&j)d tj |Stj gad a|S#1swYzxYw) Nr~__PYVENV_LAUNCHER__z pyvenv.cfgc3^K|]%}tjj|r|'ywr)rrisfile).0conffiles r zvenv.. s. &ww~~h' &s+-truezutf-8)encoding=zinclude-system-site-packageshomerF)rrrr_base_executable executablerrr_homenextropen partitionrNlowerr exec_prefixrrinsertr)r/envrexe_dir site_prefix conf_basenamecandidate_conf virtual_conf system_siterYr\keyr6values r venvrs **C ||x$9S$@,.JJ7L,MM S)^^ ggoobggooj9:G''//'*KCI M  Wm4 [-8&   N%  , 1Q$;$(NN3$7MCE))+++-C!KKME<<&+kkm $) 2(32 S_  cjj\2 & OOAszz *  |H$  12 1s$ H/AH HHc ddl}y#t$r}|jdk(rnYd}~yd}~wwxYw#t$r}tj j r%t jt jn?tjjd|jjd|dYd}~yYd}~yd}~wwxYw)z,Run custom site specific code, if available.rN sitecustomizez9Error in sitecustomize; set PYTHONVERBOSE for traceback: :  ) rrrUrQrrr excepthookexc_infor write __class____name__)rr]errs r execsitecustomizer3/   xx?*  / 99   NNCLLN + JJ  ''. / / ,/) ,'/,/ CA9B;;Cc ddl}y#t$r}|jdk(rnYd}~yd}~wwxYw#t$r}tj j r%t jt jn?tjjd|jjd|dYd}~yYd}~yd}~wwxYw)z,Run custom user specific code, if available.rN usercustomizez9Error in usercustomize; set PYTHONVERBOSE for traceback: rr) rrrUrQrrrrrr rrr)rr]rs r execusercustomizer Grrctjdd}t}|tjk7r tt |}t t at|}t|}ttttjjs ttt r t!yy)zAdd standard site-specific directories to the module search path. This function is called automatically when this module is imported, unless the python interpreter was started with the -S flag. N)rrr1r*rrrprrrrrrisolatedrrr ) orig_pathr/s r mainr [s I "KCHH  {#K/1%k2K!+.K IN K 99  rcd}tjdd}|st}t}t dtj D]}t d|dt dd}t d|d ||d t d |d ||d t d t tjd g}d|vr|jtd|vr|jt|rt tjj|t rtjd yt durtjdyt tjdytjdyd dl}t |j|tjd tjfztjdy)Na %s [--user-base] [--user-site] Without arguments print some useful information With arguments print the value of USER_BASE and/or USER_SITE separated by '%s'. Exit codes with --user-base or --user-site: 0 - user site directory is enabled 1 - user site directory is disabled by user 2 - user site directory is disabled by super user or for security reasons >2 - unknown error r<z sys.path = [z ,]cH| tjj|ryy)Nr3z doesn't exist)rrr)rs r r3z_script..existssBGGMM$$7&rz USER_BASE: z ()z USER_SITE: zENABLE_USER_SITE: rz --user-basez --user-siteFr )rargvrrr rrrr,rrrpathseprtextwrapdedent)rrx user_baserrr3bufferrs r _scriptr}si D 88AB>?@  r__main__r)(rrrrrrDrArrrrrrr rr*r1r8r_rgrprrrrrrrrrrrrrr r rno_siterrrorr rsEN   JJ (   ( &.&  ?D4@#0 K " B 7 *,90v4n/(/(> yyF4l z Ir