grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026î £ f1Tã@s¡dZddlZddlZddlZddlZejejgadada da dd„Z dd„Z dd„Z d d „Zd d „Zdd d„Zdd„Zdd„Zdd„Zdd„Zddd„Zddd„Zdd„Zdd„Zdd „Zd!d"„Zd#d$„Zd%Zd&d'„Zd(d)„Zd*d+„Zd,d-„Z ej!j"s{e ƒnd.d/„Z#e$d0kr�e#ƒndS)1aŽ 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 as well as lib/site-python. 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 and site-python (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 overriden in sitecustomize, usercustomize or PYTHONSTARTUP. 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. éNc GsStjj|Œ}ytjj|ƒ}Wntk r<YnX|tjj|ƒfS)N)ÚosÚpathÚjoinÚabspathÚOSErrorÚnormcase)ÚpathsÚdir©r ú)/opt/alt/python34/lib64/python3.4/site.pyÚmakepathYs  r cCs¼xµttjjƒƒD]ž}tt|ddƒddƒdkrFqnytjj|jƒ|_Wnt t fk r|YnXytjj|j ƒ|_ Wqt t fk r³YqXqWdS)zESet all module __file__ and __cached__ attributes to an absolute pathÚ __loader__NÚ __module__Ú_frozen_importlib) ÚsetÚsysÚmodulesÚvaluesÚgetattrrrrÚ__file__ÚAttributeErrorrÚ __cached__)Úmr r r Ú abs_pathsbs rcCsug}tƒ}xLtjD]A}t|ƒ\}}||kr|j|ƒ|j|ƒqqW|tjdd…<|S)zK Remove duplicate entries from sys.path along with making them absoluteN)rrrr ÚappendÚadd)ÚLÚ known_pathsr Údircaser r r Úremoveduppathsrs   rc Csqtƒ}xatjD]V}y8tjj|ƒrPt|ƒ\}}|j|ƒnWqtk rhwYqXqW|S)zDReturn a set containing all existing directory entries from sys.path)rrrrÚisdirr rÚ TypeError)Údr rr r r Ú_init_pathinfo…s   r#c Csß|dkrtƒ}d}nd}tjj||ƒ}yt|dƒ}Wntk rddSYnX|�_xWt|ƒD]I\}}|jdƒršqyny‚|jd ƒr¼t|ƒwyn|j ƒ}t ||ƒ\}} | |krtjj |ƒrt jj |ƒ|j| ƒnWqytk rÁtdj|d|ƒd t jƒddl} xK| jt jƒŒD]4} x+| jƒD]}td |d t jƒq„WqqWtd d t jƒPYqyXqyWWdQX|rÛd}n|S) zÖProcess 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 '. NérÚrú#úimport úimport z"Error processing line {:d} of {}: Úfilez z Remainder of file ignored)r'r()r#rrrÚopenrÚ enumerateÚ startswithÚexecÚrstripr ÚexistsrrrÚ ExceptionÚprintÚformatÚstderrÚ tracebackÚformat_exceptionÚexc_infoÚ splitlines) ÚsitedirÚnamerÚresetÚfullnameÚfÚnÚliner rr4Úrecordr r r Ú addpackage’sD           r@c CsÛ|dkrtƒ}d}nd}t|ƒ\}}||krbtjj|ƒ|j|ƒnytj|ƒ}Wntk r�dSYnXdd„|Dƒ}x$t |ƒD]}t |||ƒq®W|r×d}n|S)zTAdd 'sitedir' argument to sys.path if missing and handle .pth files in 'sitedir'Nr$rcSs%g|]}|jdƒr|‘qS)z.pth)Úendswith)Ú.0r9r r r ú Ìs zaddsitedir..) r#r rrrrrÚlistdirrÚsortedr@)r8rr:Ú sitedircaseÚnamesr9r r r Ú addsitedir¼s$       rHcCsŽtjjrdSttdƒrMttdƒrMtjƒtjƒkrMdSnttdƒrŠttdƒrŠtjƒtjƒkrŠdSndS)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 FÚgetuidÚgeteuidNÚgetgidÚgetegidT) rÚflagsÚ no_user_siteÚhasattrrrJrIrLrKr r r r Úcheck_enableusersiteÔs rPcCs0tdk rtSddlm}|dƒatS)zËReturns 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. Nr)Úget_config_varÚuserbase)Ú USER_BASEÚ sysconfigrQ)rQr r r Ú getuserbaseìs   rUcCs„tƒ}tdk rtSddlm}tjdkrjddlm}|dƒrj|ddƒatSn|dd tjƒatS) z¢Returns the user-specific site-packages directory path. If the global variable ``USER_SITE`` is not initialized yet, this function will also set it. Nr)Úget_pathÚdarwin)rQÚPYTHONFRAMEWORKÚpurelibÚosx_framework_userz%s_user) rUÚ USER_SITErTrVrÚplatformrQrr9)Ú user_baserVrQr r r Úgetusersitepackagesús   r^cCs5tƒ}tr1tjj|ƒr1t||ƒn|S)z†Add a per user site-package to sys.path Each user has its own python directory with site-packages in the home directory. )r^ÚENABLE_USER_SITErrr rH)rÚ user_siter r r Úaddusersitepackagess rac Cs§g}tƒ}|dkr$t}nx||D]t}| s+||krJq+n|j|ƒtjdkrî|jtjj|ddtj dd…dƒƒ|jtjj|ddtj dd…dƒƒ|jtjj|ddƒƒnK|j|ƒ|jtjj|ddƒƒ|jtjj|ddƒƒtj d kr+d d l m }|d ƒ}|rŸ|jtjjd |tj dd…dƒƒqŸq+q+W|S)a=Returns a list containing all global site-packages directories (and possibly site-python). 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ú/Úlib64Úpythonéz site-packagesÚlibz site-pythonrWr)rQrXz/Library) rÚPREFIXESrrÚseprrrrÚversionr\rTrQ)ÚprefixesÚ sitepackagesÚseenÚprefixrQÚ frameworkr r r Úgetsitepackagess6       "  $rocCshxat|ƒD]S}tjj|ƒr d|krPddl}|jdtƒnt||ƒq q W|S)z8Add site-packages (and possibly site-python) to sys.pathz site-pythonrNz>"site-python" directories will not be supported in 3.5 anymore)rorrr ÚwarningsÚwarnÚDeprecationWarningrH)rrjr8rpr r r ÚaddsitepackagesIs    rscCsdtjdkrd}ntjdkr0d}nd}tjd|ƒt_tjd|ƒt_dS) z­Define 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. ú:zCmd-Qú\zCtrl-Z plus ReturnzCtrl-D (i.e. EOF)ÚquitÚexitN)rrhÚ _sitebuiltinsÚQuitterÚbuiltinsrvrw)Úeofr r r ÚsetquitVs  r|cCsïtjdtjƒt_tjdd…dkrItjddƒt_ntjddƒt_gg}}ttdƒrÐtj j tj ƒ}|j d d gƒ|j tj j |tjƒ|tjgƒntjd d ||ƒt_dS) z)Set 'copyright' and 'credits' in builtinsÚ copyrightNéÚjavaÚcreditsz?Jython is maintained by the Jython developers (www.jython.org).zž Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands for supporting Python development. See www.python.org for more information.rz LICENSE.txtÚLICENSEÚlicensez'See https://www.python.org/psf/license/)rxÚ_Printerrr}rzr\r€rOrrÚdirnamerÚextendrÚpardirÚcurdirr‚)ÚfilesÚdirsÚherer r r Ú setcopyrighths    .r‹cCstjƒt_dS)N)rxÚ_HelperrzÚhelpr r r r Ú sethelper€srŽcCsdd„}|t_dS)aiEnable 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 overriden in the sitecustomize or usercustomize module, or in a PYTHONSTARTUP file. cSsddl}yddl}ddl}Wntk r@dSYnXt|ddƒ}|dk r{d|kr{|jdƒn |jdƒy|jƒWntk rªYnX|jƒdkrt j j t j j dƒdƒ}y|j |ƒWntk rYnX|j|j|ƒndS) NrÚ__doc__ÚÚlibeditzbind ^I rl_completez tab: completeú~z.python_history)ÚatexitÚreadlineÚ rlcompleterÚ ImportErrorrÚparse_and_bindÚread_init_filerÚget_current_history_lengthrrrÚ expanduserÚread_history_fileÚIOErrorÚregisterÚwrite_history_file)r“r”r•Ú readline_docÚhistoryr r r Úregister_readlineŒs,        z,enablerlcompleter..register_readlineN)rÚ__interactivehook__)r¡r r r Úenablerlcompleterƒs 'r£c Cs¡tjdkr�ddl}ddl}|jdƒ}|jdƒr�y|j|ƒWqštk r–ddl}|j |j |(\w|[-_])+)\s*=\s*(?P.*)\s*$c Csòtj}tjdkr4d|kr4tjd}n tj}tjjtjj|ƒƒ\}}tjj|ƒ}dt_ d}dd„tjj ||ƒtjj ||ƒfDƒ}|rîddl }|j t ƒ} |d} d} t| dd ƒ�–} xŒ| D]„} | jƒ} | j| ƒ}|r|jƒ}|d jƒ|d }}|d kro|jƒ} qŠ|d krŠ|t_ qŠqqWWdQX|t_t_t|tjgƒ| dkrÙtjdtjƒqîtjgadan|S)NrWÚ__PYVENV_LAUNCHER__z pyvenv.cfgcSs(g|]}tjj|ƒr|‘qSr )rrÚisfile)rBÚconffiler r r rCÓs zvenv..rÚtrueÚencodingzutf-8ÚkeyÚvaluezinclude-system-site-packagesÚhomeF)rÚenvironrr\Ú executablerÚsplitrr„Ú_homerÚreÚcompileÚ CONFIG_LINEr*ÚstripÚmatchÚ groupdictÚlowerrmÚ exec_prefixrsrgÚinsertr_)rÚenvr»Úexe_dirÚ_Ú site_prefixÚ conf_basenameÚcandidate_confsr¾Ú config_lineÚ virtual_confÚ system_siter<r>rr"r·r¸r r r ÚvenvÆsD  $            rÐcCs•yddl}Wn~tk r$Ynmtk r�}zMtjjdƒr^tjtjƒŒn tj j d|j j |fƒWYdd}~XnXdS)z,Run custom site specific code, if available.rNÚ PYTHONVERBOSEz@Error in sitecustomize; set PYTHONVERBOSE for traceback: %s: %s ) Ú sitecustomizer–r0rrºÚgetrÚ excepthookr6r3ÚwriteÚ __class__Ú__name__)rÒÚerrr r r Úexecsitecustomizeýs  rÙcCs•yddl}Wn~tk r$Ynmtk r�}zMtjjdƒr^tjtjƒŒn tj j d|j j |fƒWYdd}~XnXdS)z,Run custom user specific code, if available.rNrÑz@Error in usercustomize; set PYTHONVERBOSE for traceback: %s: %s ) Ú usercustomizer–r0rrºrÓrrÔr6r3rÕrÖr×)rÚrØr r r Úexecusercustomize s  rÛcCsŠtƒtƒ}t|ƒ}tdkr4tƒant|ƒ}t|ƒ}tƒtƒt ƒt ƒt ƒt ƒtr†t ƒndS)zÏAdd 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)rrrÐr_rPrarsr|r‹rŽr£r±rÙrÛ)rr r r Úmains      rÜcCsÜd}tjdd…}|sàtƒ}tƒ}tdƒx"tjD]}td|fƒqEWtdƒtd|tjj|ƒr‹dndfƒtd |tjj|ƒr·dndfƒtd tƒtj d ƒng}d |kr|j t ƒnd |kr|j t ƒn|r˜ttj j|ƒƒtrPtj d ƒqØtdkrltj dƒqØtdkrˆtj dƒqØtj dƒn@d dl}t|j|tjd tj fƒƒtj dƒdS)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 - uses site directory is disabled by super user or for security reasons >2 - unknown error r$z sys.path = [z %r,ú]zUSER_BASE: %r (%s)r/z doesn't existzUSER_SITE: %r (%s)zENABLE_USER_SITE: %rrz --user-basez --user-siteFéreé )rÚargvrUr^r1rrr r_rwrrSr[ÚpathseprÚtextwrapÚdedent)r�Úargsr]r`r Úbufferrâr r r Ú_script:s@     # #     'ræÚ__main__)%r�rrrzrxrmrÅrgr_r[rSr rrr#r@rHrPrUr^rarorsr|r‹rŽr£r±rÀrÐrÙrÛrÜrMÚno_siterær×r r r r ÚEsF       *    *    2  7      3