%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /snap/core20/2379/lib/python3.8/__pycache__/
Upload File :
Create Path :
Current File : //snap/core20/2379/lib/python3.8/__pycache__/site.cpython-38.pyc

U

k�]e@W�@s&dZddlZddlZddlZddlZddlZejejgada	da
dadd�Zdd�Z
dd�Zd	d
�Zdd�Zd2d
d�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd3dd�Zd4dd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Z d-d.�Z!ej"j#�s
e!�d/d0�Z$e%d1k�r"e$�dS)5a�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/python3/dist-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.

For Debian and derivatives, this sys.path is augmented with directories
for packages distributed within the distribution. Local addons go
into /usr/local/lib/python<version>/dist-packages, Debian addons
install into /usr/lib/python3/dist-packages.
/usr/lib/python<version>/site-packages is not used.

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
<package>.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.
�NcGsBtjj|�}ztj�|�}Wntk
r0YnX|tj�|�fS�N)�os�path�join�abspath�OSError�normcase)�paths�dir�r�/usr/lib/python3.8/site.py�makepathasr
cCs�ttj���D]~}tt|dd�dd�dkr,qztj�|j�|_Wnt	t
tfk
rZYnXztj�|j�|_Wqt	t
tfk
r�YqXqdS)zESet all module __file__ and __cached__ attributes to an absolute path�
__loader__N�
__module__)�_frozen_importlib�_frozen_importlib_external)
�set�sys�modules�values�getattrrrr�__file__�AttributeErrorr�	TypeError�
__cached__)�mrrr�	abs_pathsjs�rcCsPg}t�}tjD],}t|�\}}||kr|�|�|�|�q|tjdd�<|S)zK Remove duplicate entries from sys.path along with making them
    absoluteN)rrrr
�append�add)�L�known_pathsr
�dircaserrr�removeduppathszs

r"c	CsVt�}tjD]D}z&tj�|�r4t|�\}}|�|�Wqtk
rNYqYqXq|S)zEReturn a set containing all existing file system items from sys.path.)rrrr�existsr
rr)�d�item�_Zitemcaserrr�_init_pathinfo�s
r'cCsr|dkrt�}d}nd}tj�||�}zt�t�|��}Wntk
rPYdSX|��t|�D]�\}}|�	d�rvqbzZ|�	d�r�t
|�Wqb|��}t||�\}}	|	|kr�tj�
|�r�tj�|�|�|	�Wqbtk
�rVtd�|d|�tjd�d	dl}
|
jt���D](}|��D]}td
|tjd��q�qtdtjd�Y�qZYqbXqbW5QRX|�rnd}|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 '.
    NTF�#)zimport zimport	z"Error processing line {:d} of {}:
�)�filerz  z
Remainder of file ignored)r'rrr�io�
TextIOWrapper�	open_coder�	enumerate�
startswith�exec�rstripr
r#rrr�	Exception�print�format�stderr�	traceback�format_exception�exc_info�
splitlines)�sitedir�namer �reset�fullname�f�n�liner
r!r6�recordrrr�
addpackage�sF

�rBcCs�|dkrt�}d}nd}t|�\}}||krBtj�|�|�|�zt�|�}Wntk
rfYdSXdd�|D�}t	|�D]}t
|||�q~|r�d}|S)zTAdd 'sitedir' argument to sys.path if missing and handle .pth files in
    'sitedir'NTFcSsg|]}|�d�r|�qS)z.pth)�endswith)�.0r;rrr�
<listcomp>�s
zaddsitedir.<locals>.<listcomp>)r'r
rrrrr�listdirr�sortedrB)r:r r<Zsitedircase�namesr;rrr�
addsitedir�s$
rIcCs`tjjrdSttd�r4ttd�r4t��t��kr4dSttd�r\ttd�r\t��t��kr\dSdS)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�hasattrrrKrJrMrLrrrr�check_enableusersite�s
rQcCsztj�dd�}|r|Sdd�}tjdkrBtj�d�p6d}||d�Stjdkrptjrp|dd	tjd
tjdd��S|dd�S)
NZPYTHONUSERBASEcWstj�tjj|��Sr)rr�
expanduserr)�argsrrr�joinusersz_getuserbase.<locals>.joinuser�ntZAPPDATA�~ZPython�darwinZLibraryz%d.%d�z.local)r�environ�getr;r�platform�
_framework�version_info)Zenv_baserT�baserrr�_getuserbase�s


�r_cCsdtj}tjdkr,|�d|d�|d�d�StjdkrFtjrF|�d�S|�d|d�d	|d�d
�S)NrUz\Pythonrr)z\site-packagesrWz/lib/python/site-packagesz/lib/python�.z/site-packages)rr]rr;r[r\)�userbase�versionrrr�	_get_paths

rccCstdkrt�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.
    N)�	USER_BASEr_rrrr�getuserbasesrecCst�}tdkrt|�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.
    N)re�	USER_SITErc)rarrr�getusersitepackages)srgcCs$t�}tr tj�|�r t||�|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.
    )rg�ENABLE_USER_SITErr�isdirrI)r �	user_siterrr�addusersitepackages7s
rkcCsg}t�}|dkrt}|D]�}|r||kr,q|�|�tjdkr�dtjksVtjtjkr||�	tj
�|ddtjdd�d��|�	tj
�|ddtjdd�d	��|�	tj
�|dd
d	��|�	tj
�|ddtjdd�d	��q|�	|�|�	tj
�|dd��q|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�/ZVIRTUAL_ENVZlibZpython�z
site-packagesz	local/libz
dist-packagesZpython3)
r�PREFIXESrr�seprYr�base_prefix�prefixrrrrb)�prefixesZsitepackages�seenrqrrr�getsitepackagesEs:

����
rtcCs(t|�D]}tj�|�rt||�q|S)zAdd site-packages to sys.path)rtrrrirI)r rrr:rrr�addsitepackagesksrucCs4tjdkrd}nd}t�d|�t_t�d|�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.

    �\zCtrl-Z plus ReturnzCtrl-D (i.e. EOF)�quit�exitN)rro�
_sitebuiltinsZQuitter�builtinsrwrx)Zeofrrr�setquitss

r{cCs�t�dtj�t_tjdd�dkr2t�dd�t_nt�dd�t_gg}}ttd�r�tj	�
tj�}|�d	d
g�|�tj	�
|tj�|tjg�t�dd||�t_dS)
z)Set 'copyright' and 'credits' in builtins�	copyrightN�Zjava�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.rzLICENSE.txtZLICENSE�licensez'See https://www.python.org/psf/license/)ryZ_Printerrr|rzr[r~rPrr�dirnamer�extendr�pardir�curdirr)�files�dirs�hererrr�setcopyright�s$�

�r�cCst��t_dSr)ryZ_Helperrz�helprrrr�	sethelper�sr�cCsdd�}|t_dS)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.
    cs�ddl}zddl�ddl}Wntk
r2YdSXt�dd�}|dk	r\d|kr\��d�n
��d�z���Wntk
r�YnX���dkr�t	j
�t	j
�d�d��z��
��Wntk
r�YnX��fd	d
�}|�|�dS)Nr�__doc__�Zlibeditzbind ^I rl_completez
tab: completerVz.python_historycs(z����Wntk
r"YnXdSr)Zwrite_history_filerr�Zhistory�readlinerr�
write_history�szCenablerlcompleter.<locals>.register_readline.<locals>.write_history)�atexitr��rlcompleter�ImportErrorrZparse_and_bindZread_init_filerZget_current_history_lengthrrrrRZread_history_file�register)r�r�Zreadline_docr�rr�r�register_readline�s0
�z,enablerlcompleter.<locals>.register_readlineN)rZ__interactivehook__)r�rrr�enablerlcompleter�s	0r�c	CsHtj}tjdkr*d|kr*tjd}t_ntj}tj�tj�|��\}}tj�	|�}dt_
d}dd�tj�||�tj�||�fD�}|�rD|d}d}	t|dd	��\}
|
D]P}d
|kr�|�
d
�\}}}
|����}|
��}
|dkr�|
��}	q�|dkr�|
t_
q�W5QRX|t_t_t|tjg�|	dk�r8t�dtj�ntjgad
a|S)NrWZ__PYVENV_LAUNCHER__z
pyvenv.cfgcSsg|]}tj�|�r|�qSr)rr�isfile)rDZconffilerrrrE�s�zvenv.<locals>.<listcomp>rZtruezutf-8)�encoding�=zinclude-system-site-packagesZhomeF)rrYrr[�_base_executable�
executabler�splitrr�Z_homer�open�	partition�strip�lowerrq�exec_prefixrurn�insertrh)r �envr�Zexe_dirr&Zsite_prefixZ
conf_basenameZcandidate_confsZvirtual_confZsystem_siter>r@�key�valuerrr�venv�sB��

r�c
Cs�zBzddl}Wn0tk
r>}z|jdkr,n�W5d}~XYnXWnRtk
r�}z4tjjrltjt���ntj	�
d|jj|f�W5d}~XYnXdS)z,Run custom site specific code, if available.rN�
sitecustomizez@Error in sitecustomize; set PYTHONVERBOSE for traceback:
%s: %s
)
r�r�r;r2rrN�verbose�
excepthookr8r5�write�	__class__�__name__)r��exc�errrrr�execsitecustomize
s

��r�c
Cs�zBzddl}Wn0tk
r>}z|jdkr,n�W5d}~XYnXWnRtk
r�}z4tjjrltjt���ntj	�
d|jj|f�W5d}~XYnXdS)z,Run custom user specific code, if available.rN�
usercustomizez@Error in usercustomize; set PYTHONVERBOSE for traceback:
%s: %s
)
r�r�r;r2rrNr�r�r8r5r�r�r�)r�r�r�rrr�execusercustomize!s

��r�cCs~tjdd�}t�}|tjkr$t�t|�}tdkr:t�at|�}t|�}t	�t
�t�tjj
sjt�t�trzt�dS)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"rr�rhrQrkrur{r�r�rN�isolatedr�r�r�)Z	orig_pathr rrr�main5s"
r�cCs\d}tjdd�}|s�t�}t�}td�tjD]}td|f�q0td�td|tj�|�rbdndf�td	|tj�|�r�dndf�td
t�t�	d�g}d|kr�|�
t�d
|kr�|�
t�|�r(ttj
�|��tr�t�	d�n6tdk�rt�	d�n tdk�rt�	d�n
t�	d�n0ddl}t|�|tjdtj
f��t�	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-siteFrXrm�
)r�argvrergr3rrrirhrxrrdrf�pathsepr�textwrapZdedent)r�rSZ	user_baserjr
�bufferr�rrr�_scriptWsD
��




r��__main__)N)N)N)&r�rrrzryr+rqr�rnrhrfrdr
rr"r'rBrIrQr_rcrergrkrtrur{r�r�r�r�r�r�r�rN�no_siter�r�rrrr�<module>sHM	
*
 

&
;4
3


Zerion Mini Shell 1.0