Your IP : 3.15.229.217


Current Path : /usr/lib64/python2.7/
Upload File :
Current File : //usr/lib64/python2.7/site.pyc

�
zfc@sydZddlZddlZddlZddlZejejgZda	da
dad�Zd�Z
d�Zd�Zd�Zdd�Zd	�Zd
�Zd�Zd�Zd
�Zd�Zd�Zd�Zdefd��YZd�Zdefd��YZd�Zd�Zd�Z d�Z!d�Z"d�Z#d�Z$e$�d�Z%e&dkrue%�ndS(sN	Append module search paths for third-party packages to sys.path.

****************************************************************
* This module is automatically imported during initialization. *
****************************************************************

In earlier versions of Python (up to 1.5a3), scripts or modules that
needed to use site-specific modules would place ``import site''
somewhere near the top of their code.  Because of the automatic
import, this is no longer necessary (but code that does it still
works).

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<version>/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.

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.

After these path manipulations, 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.

i����NcGsRtjj|�}ytjj|�}Wntk
r;nX|tjj|�fS(N(tostpathtjointabspathtOSErrortnormcase(tpathstdir((s/usr/lib64/python2.7/site.pytmakepathOs
cCsixbtjj�D]Q}t|d�r+qnytjj|j�|_Wqtt	fk
r`qXqWdS(s6Set all module' __file__ attribute to an absolute patht
__loader__N(
tsystmodulestvaluesthasattrRRRt__file__tAttributeErrorR(tm((s/usr/lib64/python2.7/site.pytabs__file__XscCslg}t�}xLtjD]A}t|�\}}||kr|j|�|j|�qqW|tj(|S(sK Remove duplicate entries from sys.path along with making them
    absolute(tsetR
RRtappendtadd(tLtknown_pathsRtdircase((s/usr/lib64/python2.7/site.pytremoveduppathscs	

cCspt�}x`tjD]U}y8tjj|�rPt|�\}}|j|�nWqtk
rgqqXqW|S(sDReturn a set containing all existing directory entries from sys.path(RR
RRtisdirRRt	TypeError(tdRR((s/usr/lib64/python2.7/site.pyt_init_pathinfovs	
cBs�|dkre�d}nd}ejj||�}ye|d�}Wnek
r^dSX|�@x8e|�D]*\}}|jd�r�qsny�|jd�r�|dUwsn|j	�}e
||�\}}	|	|krejj|�rejj
|�|j|	�nWqsek
r�}
ejdj|d|�IJxEejej��D].}x%|j�D]}ejd	|IJqlWqYWejd
IJPqsXqsWWdQX|r�d}n|S(s�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 '.
    iitrUNt#simport simport	s"Error processing line {:d} of {}:
s  s
Remainder of file ignored(simport simport	(tNoneRRRRtopentIOErrort	enumeratet
startswithtrstripRtexistsR
RRt	Exceptiontstderrtformatt	tracebacktformat_exceptiontexc_infot
splitlines(tsitedirtnameRtresettfullnametftntlineRRterrtrecord((s/usr/lib64/python2.7/site.pyt
addpackage�sB	


	cCs�|dkrt�}d}nd}t|�\}}||krUtjj|�nytj|�}Wntjk
rdSXtj	d}g|D]}|j
|�r�|^q�}x$t|�D]}t|||�q�W|r�d}n|S(sTAdd 'sitedir' argument to sys.path if missing and handle .pth files in
    'sitedir'iiNtpth(
RRRR
RRRtlistdirterrortextseptendswithtsortedR6(R-RR/tsitedircasetnamestdotpthR.((s/usr/lib64/python2.7/site.pyt
addsitedir�s$		
(	cCs�tjjrtSttd�rMttd�rMtj�tj�krMdSnttd�r�ttd�r�tj	�tj
�kr�dSntS(s,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
    tgetuidtgeteuidtgetgidtgetegidN(R
tflagstno_user_sitetFalseR
RRBRARRDRCtTrue(((s/usr/lib64/python2.7/site.pytcheck_enableusersite�s
cCs0tdk	rtSddlm}|d�atS(s�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.
    i����(tget_config_vartuserbaseN(t	USER_BASERt	sysconfigRJ(RJ((s/usr/lib64/python2.7/site.pytgetuserbase�s
cCs�t�}tdk	rtSddlm}ddl}tjdkrvddlm}|d�rv|dd�atSn|dd	|j	�atS(
s�Returns the user-specific site-packages directory path.

    If the global variable ``USER_SITE`` is not initialized yet, this
    function will also set it.
    i����(tget_pathNtdarwin(RJtPYTHONFRAMEWORKtpurelibtosx_framework_users%s_user(
RNt	USER_SITERRMRORR
tplatformRJR.(t	user_baseRORRJ((s/usr/lib64/python2.7/site.pytgetusersitepackages�s	cCs5t�}tr1tjj|�r1t||�n|S(s�Add a per user site-package to sys.path

    Each user has its own python directory with site-packages in the
    home directory.
    (RWtENABLE_USER_SITERRRR@(Rt	user_site((s/usr/lib64/python2.7/site.pytaddusersitepackagess	cCsQg}t�}x;tD]3}|s||kr5qn|j|�tjdkrs|jtjj|dd��qtj	dkr�|jtjj|ddtj
d d��|jtjj|d	dtj
d d��|jtjj|d	d
��q|j|�|jtjj|dd��|jtjj|d	d��qW|S(s+Returns a list containing all global site-packages directories
    (and possibly site-python).

    For each directory present in the global ``PREFIXES``, this function
    will find its `site-packages` subdirectory depending on the system
    environment, and will return a list of full paths.
    tos2emxtriscostLibs
site-packagest/tlib64tpythonitlibssite-python(R[R\(RtPREFIXESRR
RURRRRtseptversion(tsitepackagestseentprefix((s/usr/lib64/python2.7/site.pytgetsitepackagess(	

"

"
#cCs:x3t�D](}tjj|�r
t||�q
q
W|S(s8Add site-packages (and possibly site-python) to sys.path(RhRRRR@(RR-((s/usr/lib64/python2.7/site.pytaddsitepackages0scCsotjjtjdd�}tjdjd�}|drK|j|�n
||d<dj|�tjd<dS(sEThe OS/2 EMX port has optional extension modules that do double duty
    as DLLs (and must use the .DLL file extension) for other extensions.
    The library search path needs to be amended so these will be found
    during module import.  Use BEGINLIBPATH so that these are at the start
    of the library search path.

    R]slib-dynloadtBEGINLIBPATHt;i����N(RRRR
RgtenvirontsplitR(tdllpathtlibpath((s/usr/lib64/python2.7/site.pytsetBEGINLIBPATH8s

csttjdkrd�ntjdkr0d�nd�dtf�fd��Y}|d�t_|d	�t_d
S(s�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.

    t:sCmd-Qs\sCtrl-Z plus ReturnsCtrl-D (i.e. EOF)tQuittercs,eZd�Z�fd�Zdd�ZRS(cSs
||_dS(N(R.(tselfR.((s/usr/lib64/python2.7/site.pyt__init__Xscsd|j�fS(NsUse %s() or %s to exit(R.(Rs(teof(s/usr/lib64/python2.7/site.pyt__repr__ZscSs+ytjj�WnnXt|��dS(N(R
tstdintcloset
SystemExit(Rstcode((s/usr/lib64/python2.7/site.pyt__call__\s
N(t__name__t
__module__RtRvRR{((Ru(s/usr/lib64/python2.7/site.pyRrWs	tquittexitN(RRctobjectt__builtin__R~R(Rr((Rus/usr/lib64/python2.7/site.pytsetquitIs		
t_PrintercBs>eZdZdZddd�Zd�Zd�Zd�ZRS(sninteractive prompt objects for printing the license text, a list of
    contributors and the copyright notice.icCs1||_||_||_||_d|_dS(N(t_Printer__namet_Printer__datat_Printer__filest_Printer__dirsRt_Printer__lines(RsR.tdatatfilestdirs((s/usr/lib64/python2.7/site.pyRtns
				cCs�|jr
dSd}x�|jD]w}xd|jD]Y}tjj||�}y*t|d�}|j�}|j	�PWq-t
k
r�q-Xq-W|rPqqW|s�|j}n|jd�|_t
|j�|_dS(NRs
(R�RR�R�RRRtfiletreadRxR!R�Rmtlent_Printer__linecnt(RsR�Rtfilenametfp((s/usr/lib64/python2.7/site.pyt__setupus&	

cCsH|j�t|j�|jkr2dj|j�Sd|jfdSdS(Ns
s!Type %s() to see the full %s texti(t_Printer__setupR�R�tMAXLINESRR�(Rs((s/usr/lib64/python2.7/site.pyRv�s
cCs�|j�d}d}x�y1x*t|||j�D]}|j|GHq3WWntk
r^PqX||j7}d}x1|dkr�t|�}|dkrud}ququW|dkrPqqWdS(Ns0Hit Return for more, or q (and Return) to quit: ittq(R�R�(R�trangeR�R�t
IndexErrorRt	raw_input(Rstprompttlinenotitkey((s/usr/lib64/python2.7/site.pyR{�s"



(((R|R}t__doc__R�RtR�RvR{(((s/usr/lib64/python2.7/site.pyR�hs		cCs�tdtj�t_tjd dkr=tdd�t_ntdd�t_tjjtj	�}tddd	d
gtjj
|tj�|tjg�t_
dS(s,Set 'copyright' and 'credits' in __builtin__t	copyrightitjavatcreditss?Jython is maintained by the Jython developers (www.jython.org).s�    Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands
    for supporting Python development.  See www.python.org for more information.tlicenses'See https://www.python.org/psf/license/sLICENSE.txttLICENSEN(R�R
R�R�RUR�RRtdirnameRRtpardirtcurdirR�(there((s/usr/lib64/python2.7/site.pytsetcopyright�s	t_HelpercBs eZdZd�Zd�ZRS(sXDefine the builtin 'help'.
    This is a wrapper around pydoc.help (with a twist).

    cCsdS(NsHType help() for interactive help, or help(object) for help about object.((Rs((s/usr/lib64/python2.7/site.pyRv�scOsddl}|j||�S(Ni����(tpydocthelp(RstargstkwdsR�((s/usr/lib64/python2.7/site.pyR{�s(R|R}R�RvR{(((s/usr/lib64/python2.7/site.pyR��s	cCst�t_dS(N(R�R�R�(((s/usr/lib64/python2.7/site.pyt	sethelper�scCs�tjdkr�ddl}ddl}|j�d}|jd�r�y|j|�Wq�tk
r�ddl}|j	|j
|<d|jj|<q�Xq�ndS(s�On Windows, some default encodings are not provided by Python,
    while they are always available as "mbcs" in each locale. Make
    them usable by aliasing to "mbcs" in such a case.twin32i����Nitcptmbcs(R
RUtlocaletcodecstgetdefaultlocaleR#tlookuptLookupErrort	encodingst_unknownt_cachetaliases(R�R�tencR�((s/usr/lib64/python2.7/site.pyt	aliasmbcs�s
cCs&d}|dkr"tj|�ndS(s�Set the string encoding used by the Unicode implementation.  The
    default is 'ascii', but if you're willing to experiment, you can
    change this.tasciiN(R
tsetdefaultencoding(tencoding((s/usr/lib64/python2.7/site.pytsetencoding�scCsgyddl}WnPtk
r#n@tk
rbtjjrRtjtj��qctjdIJnXdS(s,Run custom site specific code, if available.i����Ns3'import sitecustomize' failed; use -v for traceback(	t
sitecustomizetImportErrorR&R
REtverboset
excepthookR+R'(R�((s/usr/lib64/python2.7/site.pytexecsitecustomize�s

cCsgyddl}WnPtk
r#n@tk
rbtjjrRtjtj��qctjdIJnXdS(s,Run custom user specific code, if available.i����Ns3'import usercustomize' failed; use -v for traceback(	t
usercustomizeR�R&R
RER�R�R+R'(R�((s/usr/lib64/python2.7/site.pytexecusercustomize�s

cCsjtjdkrftjjd�}|dkr=tjdIJqf|dkrftjdIJtd�qfndS(	s�Warn or fail if /usr/bin/python is used

    Behavior depends on the value of PYTHON_DISALLOW_AMBIGUOUS_VERSION:
    - "warn" - print warning to stderr
    - "1" - print error and exit with positive exit code
    - otherwise: do nothing

    This is a Fedora modification, see the Change page for details:
    See https://fedoraproject.org/wiki/Changes/Avoid_usr_bin_python_in_RPM_Build
    s/usr/bin/pythont!PYTHON_DISALLOW_AMBIGUOUS_VERSIONtwarnsNDEPRECATION WARNING: python2 invoked with /usr/bin/python.
    Use /usr/bin/python3 or /usr/bin/python2
    /usr/bin/python will be removed or switched to Python 3 in the future.
    If you cannot make the switch now, please follow instructions at https://fedoraproject.org/wiki/Changes/Avoid_usr_bin_python_in_RPM_Build#Quick_Opt-Outt1sERROR: python2 invoked with /usr/bin/python.
    Use /usr/bin/python3 or /usr/bin/python2
    /usr/bin/python will be switched to Python 3 in the future.
    More details are at https://fedoraproject.org/wiki/Changes/Avoid_usr_bin_python_in_RPM_Build#Quick_Opt-OutiN(R
t
executableRRltgetR'R(tsetting((s/usr/lib64/python2.7/site.pythandle_ambiguous_python_versions	cCst�t�}ddlm}|�r_ddlm}tjjt	jj
|dd��ntdkrwt
�ant|�}t|�}tjdkr�t�nt�t�t�t�t�t�tr�t�nttd�r�t`nt�dS(Ni����(tis_python_build(tbuild_time_varstabs_builddirtModulesR[R�(RRRMR�t_sysconfigdataR�R
RRRRRXRRIRZRiRURpR�R�R�R�R�R�R�R
R�R�(RR�R�((s/usr/lib64/python2.7/site.pytmain)s.		&

	cCs�d}tjd}|s�dGHxtjD]}d|fGHq(WdGHdttjjt�radndfGHd	ttjjt�r�dndfGHd
tGHtjd�ng}d|kr�|j	t�nd
|kr�|j	t�n|r]tj
j|�GHtrtjd�q�ttkr1tjd�q�tdkrMtjd�q�tjd�n;ddl}|j|tjdtj
f�GHtjd�dS(Ns�    %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
    issys.path = [s    %r,t]sUSER_BASE: %r (%s)R%s
doesn't existsUSER_SITE: %r (%s)sENABLE_USER_SITE: %ris--user-bases--user-siteiii����i
(R
targvRRLRRRTRXRRtpathsepRRGRttextwraptdedent(R�R�RtbufferR�((s/usr/lib64/python2.7/site.pyt_scriptIs<
!!	"t__main__('R�R
RR�R)Rgtexec_prefixRbRRXRTRLRRRRR6R@RIRNRWRZRhRiRpR�R�R�R�R�R�R�R�R�R�R�R�R�R|(((s/usr/lib64/python2.7/site.pyt<module>;sH					
	)					 			=	
						#		1

?>