%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python2.7/site-packages/salt/modules/
Upload File :
Create Path :
Current File : //lib/python2.7/site-packages/salt/modules/virtualenv_mod.pyo

�
���^c@@s�dZddlmZmZmZddlZddlZddlZddlZddl	Z	ddl
ZddlZddl
ZddlZddlmZmZddlmZedje	jd �dje	jd�d	g�Zeje�Ziejjje�pd	d
6ZiZd	Z d�Z!de#e#e#dddde#ddde#dd
�Z$d�Z%d�Z&ddd�Z'ddd�Z(de#d�Z)d�Z*d�Z+dS(u;
Create virtualenv environments.

.. versionadded:: 0.17.0
i(tabsolute_importtprint_functiontunicode_literalsN(tCommandExecutionErrortSaltInvocationError(tstring_typesuvirtualenv-{0}.{1}iu
virtualenv{0}u
virtualenvuvenv_bincC@stS(N(t__virtualname__(((s?/usr/lib/python2.7/site-packages/salt/modules/virtualenv_mod.pyt__virtual__*subasecK@s|dkr-tjd�p'tjd�}n|g}d|krD|dk	rftdj|���n$|
dk	r�tdj|���ny`ddl}t|d|j�}t	g|j
d�dj
d	�D]}t|�^q��}Wn�tk
r�|d
g}t
d|d|d
t|�}|ddksF|dj�ratdj||���nt	g|dj�j
d�dj
d	�D]}t|�^q��}nX|r�|d8kr�tjd�q�|jd�n|dk	r@|j�dkr@tjjj|�s'tdj|���n|jdj|��n|dk	r�t|t�r�|j�dkr�g|j
d�D]}|j�^q}}nx'|D]}|jdj|��q�Wn|tkr
d9|ko�d:knr�tjd�q
|jd�n|dk	rB|j�dkrB|jdj|��qBn�|dk	rz|j�dkrztdj|���n�|dk	r�|j�dkr�tdj|���nZ|dk	r�td j|���n6|dk	r
|j�dkr
td!j|���n|tkr&|jd"�n|
tkrB|jd#�n|tkr^|jd$�n|tkrz|jd%�n|j|�t
d|d|d
t|�}|ddkr�|Stjjj�rtjj|d&d'�}tjj|d&d(�}tjj|d&d)�}nHtjj|d*d+�}tjj|d*d,�}tjj|d*d-�}|	sk|r�tjj|�r�td.|||d/|d0|
�x6t j tjj|d1��D]}tj!|�q�Wn|ddkr�|S|	r{tjj|�r{td2|||d/|d0|
�}|j"d3|dd4d5j|d|d�j�d6d5j|d7|d7�j��n|S(;u�
    Create a virtualenv

    path
        The path to the virtualenv to be created

    venv_bin
        The name (and optionally path) of the virtualenv command. This can also
        be set globally in the minion config file as ``virtualenv.venv_bin``.
        Defaults to ``virtualenv``.

    system_site_packages : False
        Passthrough argument given to virtualenv or pyvenv

    distribute : False
        Passthrough argument given to virtualenv

    pip : False
        Install pip after creating a virtual environment. Implies
        ``distribute=True``

    clear : False
        Passthrough argument given to virtualenv or pyvenv

    python : None (default)
        Passthrough argument given to virtualenv

    extra_search_dir : None (default)
        Passthrough argument given to virtualenv

    never_download : None (default)
        Passthrough argument given to virtualenv if True

    prompt : None (default)
        Passthrough argument given to virtualenv if not None

    symlinks : None
        Passthrough argument given to pyvenv if True

    upgrade : None
        Passthrough argument given to pyvenv if True

    user : None
        Set ownership for the virtualenv

        .. note::
            On Windows you must also pass a ``password`` parameter. Additionally,
            the user must have permissions to the location where the virtual
            environment is being created

    runas : None
        Set ownership for the virtualenv

        .. deprecated:: 2014.1.0
            ``user`` should be used instead

    use_vt : False
        Use VT terminal emulation (see output while installing)

        .. versionadded:: 2015.5.0

    saltenv : 'base'
        Specify a different environment. The default environment is ``base``.

        .. versionadded:: 2014.1.0

    .. note::
        The ``runas`` argument is deprecated as of 2014.1.0. ``user`` should be
        used instead.

    CLI Example:

    .. code-block:: bash

        salt '*' virtualenv.create /path/to/new/virtualenv
    uvenv_binupyvenvu;The `upgrade`(`--upgrade`) option is not supported by '{0}'u=The `symlinks`(`--symlinks`) option is not supported by '{0}'iNu__version__urcu.u	--versionucmd.run_alltrunastpython_shelluretcodeustdoutuKUnable to get the virtualenv version output using '{0}'. Returned data: {1}ii
u�The virtualenv '--distribute' option has been deprecated in virtualenv(>=1.10), as such, the 'distribute' option to `virtualenv.create()` has also been deprecated and it's not necessary anymore.u--distributeuu#Cannot find requested python ({0}).u--python={0}u,u--extra-search-dir={0}iu�--never-download was deprecated in 1.10.0, but reimplemented in 14.0.0. If this feature is needed, please install a supported virtualenv version.u--never-downloadu--prompt='{0}'u9The `python`(`--python`) option is not supported by '{0}'uMThe `extra_search_dir`(`--extra-search-dir`) option is not supported by '{0}'uIThe `never_download`(`--never-download`) option is not supported by '{0}'u9The `prompt`(`--prompt`) option is not supported by '{0}'u	--upgradeu
--symlinksu--clearu--system-site-packagesuScriptsu
python.exeupip.exeueasy_install.exeubinupythonupipueasy_installu=https://bitbucket.org/pypa/setuptools/raw/default/ez_setup.pytsaltenvtuse_vtudistribute-*.tar.gz*u$https://bootstrap.pypa.io/get-pip.pytretcodetstdoutu{0}
{1}tstderrustderr(ii
(ii
(iii(#tNonet__opts__tgett
__pillar__Rtformatt
virtualenvtgetattrtvirtualenv_versionttupletsplittinttImportErrort__salt__tFalsetstriptlogtinfotappendtsalttutilstpathtwhicht
isinstanceRtTruetplatformt
is_windowstostjointexistst_install_scripttglobtunlinktupdate(R#tvenv_bintsystem_site_packagest
distributetcleartpythontextra_search_dirtnever_downloadtprompttpiptsymlinkstupgradetuserRR
tkwargstcmdRtversiontitvirtualenv_version_infotversion_cmdtrettetentrytvenv_pythontvenv_piptvenv_setuptoolstfpatht_ret((s?/usr/lib/python2.7/site-packages/salt/modules/virtualenv_mod.pytcreate.s�\!		<
!C
+


%	
 $cC@sOt|�}td|d�}|ddkrGtdj|���n|dS(u�
    Return the path to the site-packages directory of a virtualenv

    venv
        Path to the virtualenv.

    CLI Example:

    .. code-block:: bash

        salt '*' virtualenv.get_site_packages /path/to/my/venv
    ucmd.exec_code_alluBfrom distutils import sysconfig; print(sysconfig.get_python_lib())uretcodeiu{stdout}
{stderr}ustdout(t_verify_virtualenvRRR(tvenvtbin_pathRB((s?/usr/lib/python2.7/site-packages/salt/modules/virtualenv_mod.pytget_site_packages4s
	cC@sbt|�t|�}td|dj|��}|ddkrZtdj|���n|dS(u�
    Return the path to a distribution installed inside a virtualenv

    .. versionadded:: 2016.3.0

    venv
        Path to the virtualenv.
    distribution
        Name of the distribution. Note, all non-alphanumeric characters
        will be converted to dashes.

    CLI Example:

    .. code-block:: bash

        salt '*' virtualenv.get_distribution_path /path/to/my/venv my_distribution
    ucmd.exec_code_alluKimport pkg_resources; print(pkg_resources.get_distribution('{0}').location)uretcodeiu{stdout}
{stderr}ustdout(t_verify_safe_py_codeRKRRR(RLtdistributionRMRB((s?/usr/lib/python2.7/site-packages/salt/modules/virtualenv_mod.pytget_distribution_pathOs
cC@sht||�t|�}td|dj||��}|ddkr`tdj|���n|dS(u�
    Return the path to a package resource installed inside a virtualenv

    .. versionadded:: 2015.5.0

    venv
        Path to the virtualenv

    package
        Name of the package in which the resource resides

        .. versionadded:: 2016.3.0

    resource
        Name of the resource of which the path is to be returned

        .. versionadded:: 2016.3.0

    CLI Example:

    .. code-block:: bash

        salt '*' virtualenv.get_resource_path /path/to/my/venv my_package my/resource.xml
    ucmd.exec_code_alluJimport pkg_resources; print(pkg_resources.resource_filename('{0}', '{1}'))uretcodeiu{stdout}
{stderr}ustdout(RORKRRR(RLtpackagetresourceRMRB((s?/usr/lib/python2.7/site-packages/salt/modules/virtualenv_mod.pytget_resource_pathrs
cC@sht||�t|�}td|dj||��}|ddkr`tdj|���n|dS(u
    Return the content of a package resource installed inside a virtualenv

    .. versionadded:: 2015.5.0

    venv
        Path to the virtualenv

    package
        Name of the package in which the resource resides

        .. versionadded:: 2016.3.0

    resource
        Name of the resource of which the content is to be returned

        .. versionadded:: 2016.3.0

    CLI Example:

    .. code-block:: bash

        salt '*' virtualenv.get_resource_content /path/to/my/venv my_package my/resource.xml
    ucmd.exec_code_alluHimport pkg_resources; print(pkg_resources.resource_string('{0}', '{1}'))uretcodeiu{stdout}
{stderr}ustdout(RORKRRR(RLRRRSRMRB((s?/usr/lib/python2.7/site-packages/salt/modules/virtualenv_mod.pytget_resource_content�s
cC@s�tjjj�s-tjjjd|�}ntd||�}tjjj�s�td||�}tj||�t	j
|d�t	j|td|�d�nz=td||gd|d|d	i|d
6d|dt�SWdt	j
|�XdS(
Ntdiru
cp.cache_filei@ufile.user_to_uidi����ucmd.run_allRtcwdtenvuVIRTUAL_ENVRR	(R!R"R'R(tfilestmkstempRtshutiltcopyfileR)tchmodtchownRtremove(tsourceRWR4R;R
Rttmppathtfn_((s?/usr/lib/python2.7/site-packages/salt/modules/virtualenv_mod.pyR,�s" 
cG@sBx;|D]3}tjjj|�stdj|���qqWdS(Nu$Unsafe python code detected in '{0}'(R!R"tverifytsafe_py_codeRR(targstarg((s?/usr/lib/python2.7/site-packages/salt/modules/virtualenv_mod.pyRO�s
cC@sCtjj|d�}tjj|�s?tdj|���n|S(Nu
bin/pythonuDPath '{0}' does not appear to be a virtualenv: bin/python not found.(R)R#R*R+RR(t	venv_pathRM((s?/usr/lib/python2.7/site-packages/salt/modules/virtualenv_mod.pyRK�s
(,t__doc__t
__future__RRRR-R[tloggingR)tsystsalt.utils.filesR!tsalt.utils.pathtsalt.utils.platformtsalt.utils.verifytsalt.exceptionsRRtsalt.ext.sixRt	frozensetRtversion_infotKNOWN_BINARY_NAMESt	getLoggert__name__RR"R#t	which_binRRRRRRRJRNRQRTRUR,RORK(((s?/usr/lib/python2.7/site-packages/salt/modules/virtualenv_mod.pyt<module>sZ	�		$,+	

Zerion Mini Shell 1.0