%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python2.7/site-packages/salt/modules/
Upload File :
Create Path :
Current File : //usr/lib/python2.7/site-packages/salt/modules/pyenv.pyc

�
���^c@@s�dZddlmZmZmZddlZddlZddlZyddlm	Z
Wn!ek
r}ddlm	Z
nXej
e�Zidd6Zidd6dd6Zd	dddd
�Zdd�Zdd�Zdd
�Zdd�Zdd�Zddd�Zddd�Zdd�Zdd�Zdd�Zdd�Zddd�Zdd�Z dd�Z!ddd�Z"dd�Z#dS(u�
Manage python installations with pyenv.

.. note::
    Git needs to be installed and available via PATH if pyenv is to be
    installed automatically by the module.

.. versionadded:: v2014.04
i(tabsolute_importtunicode_literalstprint_functionN(tquoteulistulist_u
pyenv.rootupyenv.build_envucC@s�t|�stSt|�}t|�}|r@dj|�}n|pId}dj|||�}tddj|||�d|�}t|t�r�|j|�|S|ddkr�|d	StSdS(
Nu {0}uuenv PYENV_ROOT={0}{1} {2}ucmd.run_allu{0} {1} {2}trunasuretcodeiustdout(	tis_installedtFalset
_pyenv_bint_pyenv_pathtformatt__salt__t
isinstancetdicttupdate(tcommandtargstenvRtrettbinarytpathtresult((s6/usr/lib/python2.7/site-packages/salt/modules/pyenv.pyt_pyenv_exec%s"	
cC@st|�}dj|�S(Nu
{0}/bin/pyenv(RR	(RR((s6/usr/lib/python2.7/site-packages/salt/modules/pyenv.pyRAscC@sZd}|dkr+tdd�p%d}ntdd�pGdj|�}tjj|�S(Nurootu
config.optionu
pyenv.rootu/usr/local/pyenvu~{0}/.pyenv(Nuroot(tNoneR
R	tosRt
expanduser(RR((s6/usr/lib/python2.7/site-packages/salt/modules/pyenv.pyRFs
cC@s9tjj|�rtSdtddj|�d|�kS(Niucmd.retcodeu/git clone https://github.com/yyuu/pyenv.git {0}R(RRtisdirtTrueR
R	(RR((s6/usr/lib/python2.7/site-packages/salt/modules/pyenv.pyt_install_pyenvPs
cC@s?tjj|�stSdtddjt|��d|�kS(Niucmd.retcodeucd {0} && git pullR(RRRRR
R	t
_cmd_quote(RR((s6/usr/lib/python2.7/site-packages/salt/modules/pyenv.pyt
_update_pyenvXs
cC@sNdj|�}tjj|�s%tSdtddjt|��d|�kS(Nu{0}/plugins/python-buildiucmd.retcodeucd {0} && git pullR(R	RRRRR
R(RR((s6/usr/lib/python2.7/site-packages/salt/modules/pyenv.pyt_update_python_build`s

cC@s1|pt|�}tjj|�}t||�S(un
    Install pyenv systemwide

    CLI Example:

    .. code-block:: bash

        salt '*' pyenv.install
    (RRRRR(RR((s6/usr/lib/python2.7/site-packages/salt/modules/pyenv.pytinstallis
cC@s1|pt|�}tjj|�}t||�S(u�
    Updates the current versions of pyenv and python-Build

    CLI Example:

    .. code-block:: bash

        salt '*' pyenv.update
    (RRRRR(RR((s6/usr/lib/python2.7/site-packages/salt/modules/pyenv.pyR
xs
cC@stdt|��S(uw
    Check if pyenv is installed.

    CLI Example:

    .. code-block:: bash

        salt '*' pyenv.is_installed
    ucmd.has_exec(R
R(R((s6/usr/lib/python2.7/site-packages/salt/modules/pyenv.pyR�s
c	C@s�tjdd|�}d}g}tddkrA|jd�ntdd	�rk|jtdd	��n|r�d
j|�}ni}td|d|d
|d|�}|ddkr�td
|�|dSt	|d
|�t
SdS(u�
    Install a python implementation.

    python
        The version of python to install, should match one of the
        versions listed by pyenv.list

    CLI Example:

    .. code-block:: bash

        salt '*' pyenv.install_python 2.0.0-p0
    u^python-uuosuFreeBSDuNetBSDuOpenBSDu
MAKE=gmakeu
config.optionupyenv.build_envu uinstallRRRuretcodeiustderrN(uFreeBSDuNetBSDuOpenBSD(tretsubRt
__grains__tappendR
tjoinRtrehashtuninstall_pythonR(tpythonRRtenv_listR((s6/usr/lib/python2.7/site-packages/salt/modules/pyenv.pytinstall_python�s !
cC@s;tjdd|�}dj|�}td|d|�tS(u)
    Uninstall a python implementation.

    python
        The version of python to uninstall. Should match one of the versions
        listed by :mod:`pyenv.versions <salt.modules.pyenv.versions>`

    CLI Example:

    .. code-block:: bash

        salt '*' pyenv.uninstall_python 2.0.0-p0
    u^python-uu--force {0}u	uninstallR(R R!R	RR(R'RR((s6/usr/lib/python2.7/site-packages/salt/modules/pyenv.pyR&�scC@s/tddd|�}|tkr%gS|j�S(u}
    List the installed versions of python.

    CLI Example:

    .. code-block:: bash

        salt '*' pyenv.versions
    uversionsu--bareR(RRt
splitlines(RR((s6/usr/lib/python2.7/site-packages/salt/modules/pyenv.pytversions�s
cC@sM|rtd|d|�tStdd|�}|tkr?dS|j�SdS(u�
    Returns or sets the currently defined default python.

    python=None
        The version to set as the default. Should match one of the versions
        listed by :mod:`pyenv.versions <salt.modules.pyenv.versions>`. Leave
        blank to return the current default.

    CLI Example:

    .. code-block:: bash

        salt '*' pyenv.default
        salt '*' pyenv.default 2.0.0-p0
    uglobalRuN(RRRtstrip(R'RR((s6/usr/lib/python2.7/site-packages/salt/modules/pyenv.pytdefault�s
cC@sdg}tddd|�}|r`x<|j�D]+}|dkrFq.n|j|j��q.Wn|S(u{
    List the installable versions of python.

    CLI Example:

    .. code-block:: bash

        salt '*' pyenv.list
    uinstallu--listRuAvailable versions:(RR*R#R,(RRtoutputtline((s6/usr/lib/python2.7/site-packages/salt/modules/pyenv.pytlist_�s
cC@stdd|�tS(u�
    Run pyenv rehash to update the installed shims.

    CLI Example:

    .. code-block:: bash

        salt '*' pyenv.rehash
    urehashR(RR(R((s6/usr/lib/python2.7/site-packages/salt/modules/pyenv.pyR%s
cC@s�t|�}|j�}d}x"|D]}|dt|�}q%Wtddjt|�|�d|dt�}|ddkr�td|�|d	StSd
S(u�
    Execute a python command with pyenv's shims from the user or the system.

    CLI Example:

    .. code-block:: bash

        salt '*' pyenv.do 'gem list bundler'
        salt '*' pyenv.do 'gem list bundler' deploy
    uu ucmd.run_alluenv PATH={0}/shims:$PATH {1}Rtpython_shelluretcodeiustdoutN(RtsplitRR
R	RR%R(tcmdlineRRt	cmd_splittquoted_linetcmdR((s6/usr/lib/python2.7/site-packages/salt/modules/pyenv.pytdos
	
cC@s1|rdj||�}n|}t|d|�S(u
    Execute a python command with pyenv's shims using a specific python version.

    CLI Example:

    .. code-block:: bash

        salt '*' pyenv.do_with_python 2.0.0-p0 'gem list bundler'
        salt '*' pyenv.do_with_python 2.0.0-p0 'gem list bundler' deploy
    uPYENV_VERSION={0} {1}R(R	R7(R'R3RR6((s6/usr/lib/python2.7/site-packages/salt/modules/pyenv.pytdo_with_python6s($t__doc__t
__future__RRRRR tloggingtshlexRRtImportErrortpipest	getLoggert__name__tlogt__func_alias__Rt__opts__RRRRRRRR
RR)R&R+R-R0R%R7R8(((s6/usr/lib/python2.7/site-packages/salt/modules/pyenv.pyt<module>
s>



	
'

Zerion Mini Shell 1.0