%PDF- %PDF-
Mini Shell

Mini Shell

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

�
���^c@@s�dZddlmZmZmZddlZdd�Zdd�Ze	dd�Z
e	dd�Zdd�Zdd	�Z
dd
�ZdS(u�
Managing python installations with pyenv
========================================

This module is used to install and manage python installations with pyenv.
Different versions of python can be installed, and uninstalled. pyenv will
be installed automatically the first time it is needed and can be updated
later. This module will *not* automatically install packages which pyenv
will need to compile the versions of python.

If pyenv is run as the root user then it will be installed to /usr/local/pyenv,
otherwise it will be installed to the users ~/.pyenv directory. To make
pyenv available in the shell you may need to add the pyenv/shims and pyenv/bin
directories to the users PATH. If you are installing as root and want other
users to be able to access pyenv then you will need to add pyenv_ROOT to
their environment.

This is how a state configuration could look like:

.. code-block:: yaml

    pyenv-deps:
      pkg.installed:
        - pkgs:
          - make
          - build-essential
          - libssl-dev
          - zlib1g-dev
          - libbz2-dev
          - libreadline-dev
          - libsqlite3-dev
          - wget
          - curl
          - llvm
    python-2.6:
      pyenv.absent:
        - require:
          - pkg: pyenv-deps

    python-2.7.6:
      pyenv.installed:
        - default: True
        - require:
          - pkg: pyenv-deps

.. note::
    Git needs to be installed and available via PATH if pyenv is to be
    installed automatically by the module.
i(tabsolute_importtunicode_literalstprint_functionNcC@s+td|�s't|d<d|d<n|S(u-
    Check to see if pyenv is installed.
    upyenv.is_installeduresultupyenv is not installed.ucomment(t__salt__tFalse(trettuser((s5/usr/lib/python2.7/site-packages/salt/states/pyenv.pyt_check_pyenv9s

cC@sftdd|�}xLtd|�D]:}||kr$t|d<d|d<||k|d<Pq$q$W|S(u4
    Check to see if given python is installed.
    u
pyenv.defaulttrunasupyenv.versionsuresultuRequested python exists.ucommentudefault(RtTrue(RtpythonRtdefaulttversion((s5/usr/lib/python2.7/site-packages/salt/states/pyenv.pyt_python_installedCs

cC@s�t||d|�}|dstd|d|�rdt|d<d|d|<d|d<||d	<qt|d<d
|d<|Sn|r�td|d|�n|S(uA
    Verify that python is installed, install if unavailable
    Ruresultupyenv.install_pythonRu	InstalleduchangesuSuccessfully installed pythonucommentudefaultuCould not install python.u
pyenv.default(R
RR	R(RR
RR((s5/usr/lib/python2.7/site-packages/salt/states/pyenv.pyt_check_and_install_pythonRs





cC@s�i|d6d
d6dd6id6}|jd�rItjdd|�}ntdrjd	j|�|d<|St||�}|dtkr�td
|�s�d|d<|St	|||d|�Snt	|||d|�Sd
S(uS
    Verify that the specified python is installed with pyenv. pyenv is
    installed if necessary.

    name
        The version of python to install

    default : False
        Whether to make this python the default.

    user: None
        The user to run pyenv as.

        .. versionadded:: 0.17.0

    .. versionadded:: 0.16.0
    unameuresultuucommentuchangesupython-u^python-utestu!python {0} is set to be installedu
pyenv.installupyenv failed to installRN(
tNonet
startswithtretsubt__opts__tformatRRRR(tnameRRR((s5/usr/lib/python2.7/site-packages/salt/states/pyenv.pyt	installedhs"

cC@s�t||d|�}|dr�|dr@tddd|�ntd|d|�r|t|d<d|d	|<d
|d<|St|d<d|d<|Snt|d<d
j|�|d<|S(u+
    Verify that python is uninstalled
    Ruresultudefaultu
pyenv.defaultusystemRupyenv.uninstall_pythonuUninstalleduchangesuSuccessfully removed pythonucommentuFailed to uninstall pythonupython {0} is already absent(R
RR	RR(RR
R((s5/usr/lib/python2.7/site-packages/salt/states/pyenv.pyt_check_and_uninstall_python�s






cC@s�i|d6dd6dd6id6}|jd�rItjdd|�}ntdrjd	j|�|d<|St||�}|dtkr�t|d<d
j|�|d<|St	||d|�SdS(
u
    Verify that the specified python is not installed with pyenv. pyenv
    is installed if necessary.

    name
        The version of python to uninstall

    user: None
        The user to run pyenv as.

        .. versionadded:: 0.17.0

    .. versionadded:: 0.16.0
    unameuresultuucommentuchangesupython-u^python-utestu#python {0} is set to be uninstalledu#pyenv not installed, {0} not eitherRN(
RRRRRRRRR	R(RRR((s5/usr/lib/python2.7/site-packages/salt/states/pyenv.pytabsent�s"

cC@sGi|d6dd6dd6id6}tdr:d|d<|St||�S(	u�
    Install pyenv if not installed. Allows you to require pyenv be installed
    prior to installing the plugins. Useful if you want to install pyenv
    plugins via the git or file modules and need them installed before
    installing any rubies.

    Use the pyenv.root configuration option to set the path for pyenv if you
    want a system wide install that is not in a user home dir.

    user: None
        The user to run pyenv as.
    unameuresultuucommentuchangesutestupyenv is set to be installedN(RRR(RRR((s5/usr/lib/python2.7/site-packages/salt/states/pyenv.pyt
install_pyenv�s

"

(t__doc__t
__future__RRRRRRR
RRRRRR(((s5/usr/lib/python2.7/site-packages/salt/states/pyenv.pyt<module>2s
&!

Zerion Mini Shell 1.0