%PDF- %PDF-
Mini Shell

Mini Shell

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

�
���^c
@@s�dZddlmZmZmZddlZddlZddlm	Z	d�Z
ddeedeeded�	Z
dded�Zddeedeedd�ZdS(	u:
Manage Chocolatey package installs
.. versionadded:: 2016.3.0

.. note::
    Chocolatey pulls data from the Chocolatey internet database to determine
    current versions, find available versions, etc. This is normally a slow
    operation and may be optimized by specifying a local, smaller chocolatey
    repo.
i(tabsolute_importtprint_functiontunicode_literalsN(tSaltInvocationErrorcC@sdtkrdStS(u+
    Load only if chocolatey is loaded
    uchocolatey.installu
chocolatey(t__salt__tFalse(((s:/usr/lib/python2.7/site-packages/salt/states/chocolatey.pyt__virtual__sc
C@s�|r|	rtd��ni|d6td6id6dd6}
tddt�}|j�g|j�D]}|j�^qfkr�|r�id	j|�|6|
d<q�id
|6|
d<n�tdd|d
td|�}
|}x/|
D]'}|j�|j�kr�|}q�q�W|
|dd}|r6tjjj	d|ddd|�r�|r�idj|�|6|
d<dj||�|
d<q3dj||�|
d<t
dr�d)|
d<n|
Sq�|	r�idj||�|6|
d<dj|||�|
d<q�idj||�|6|
d<dj|||�|
d<t}np|}|ruidj|�|6|
d<dj||�|
d<n1dj||�|
d<t
dr�d)|
d<n|
St
dr�d)|
d<d|
d<|
Stdd|d|d|d |d!|d"|d#|d$|d%|d&|	�
}d'|kr*t|
d<n
t|
d<|
dsTd(j|�|
d<ntddt�}tjj
j||�|
d<|
S(*u�
    Installs a package if not already installed

    Args:

        name (str):
            The name of the package to be installed. Required.

        version (str):
            Install a specific version of the package. Defaults to latest
            version. If the version is different to the one installed then the
            specified version will be installed. Default is None.

        source (str):
            Chocolatey repository (directory, share or remote URL, feed).
            Defaults to the official Chocolatey feed. Default is None.

        force (bool):
            Reinstall the current version of an existing package. Do not use
            with ``allow_multiple``. Default is False.

        pre_versions (bool):
            Include pre-release packages. Default is False.

        install_args (str):
            Install arguments you want to pass to the installation process, i.e
            product key or feature list. Default is None.

        override_args (bool):
            Set to True if you want to override the original install arguments
            (for the native installer) in the package and use your own. When
            this is set to False install_args will be appended to the end of the
            default arguments. Default is False.

        force_x86 (bool):
            Force x86 (32bit) installation on 64 bit systems. Default is False.

        package_args (str):
            Arguments you want to pass to the package. Default is None.

        allow_multiple (bool):
            Allow mulitiple versions of the package to be installed. Do not use
            with ``force``. Does not work with all packages. Default is False.

            .. versionadded:: 2017.7.0

    .. code-block:: yaml

        Installsomepackage:
          chocolatey.installed:
            - name: packagename
            - version: '12.04'
            - source: 'mychocolatey/source'
            - force: True
    u7Cannot use 'force' in conjunction with 'allow_multiple'unameuresultuchangesuucommentuchocolatey.listt
local_onlyuVersion {0} will be installedu Latest version will be installeduchocolatey.versiontnametcheck_remotetsourceu	installeditver1toperu==tver2uVersion {0} will be reinstalleduReinstall {0} {1}u{0} {1} is already installedutestuHVersion {0} will be installed side by side with Version {1} if supportedu)Install {0} {1} side-by-side with {0} {2}u.Version {0} will be installed over Version {1}uInstall {0} {1} over {0} {2}uThe installation was testeduchocolatey.installtversiontforcetpre_versionstinstall_argst
override_argst	force_x86tpackage_argstallow_multipleuRunning chocolatey failedu!Failed to install the package {0}N(RtTrueRtlowertkeystformattsalttutilstversionstcomparet__opts__tNoneRtdatat
compare_dicts(RRR
RRRRRRRtrettpre_installtpackagetversion_infot	full_nametpkgtinstalled_versiontresulttpost_install((s:/usr/lib/python2.7/site-packages/salt/states/chocolatey.pyt	installeds�:

1	



	




	


c	C@s�i|d6td6id6dd6}tddt�}|j�g|j�D]}|j�^qKkr�y)idj|||d	�|6|d<Wq�tk
r�id
j|�|6|d<q�Xndj|�|d<|Stdr�d|d<d
|d<|Std||||�}d|kr+t|d<n
t|d<|dsUdj|�|d<ntddt�}t	j
jj||�|d<|S(u�
    Uninstalls a package

    name
      The name of the package to be uninstalled

    version
      Uninstalls a specific version of the package. Defaults to latest
      version installed.

    uninstall_args
      A list of uninstall arguments you want to pass to the uninstallation
      process i.e product key or feature list

    override_args
      Set to true if you want to override the original uninstall arguments (
      for the native uninstaller)in the package and use your own.
      When this is set to False uninstall_args will be appended to the end of
      the default arguments

    .. code-block: yaml

      Removemypackage:
        chocolatey.uninstalled:
          - name: mypackage
          - version: '21.5'

    unameuresultuchangesuucommentuchocolatey.listRu{0} version {1} will be removediu{0} will be removedu The package {0} is not installedutestuThe uninstall was testeduchocolatey.uninstalluRunning chocolatey failedu#Failed to uninstall the package {0}N(
RRRRRtKeyErrorRRRRRR R!(	RRtuninstall_argsRR"t
pre_uninstallR$R)tpost_uninstall((s:/usr/lib/python2.7/site-packages/salt/states/chocolatey.pytuninstalled�s<

1 
!



	


c	C@si|d6td6id6dd6}	tddt�}
|j�g|
j�D]}|j�^qKkr�|r�dj|�|	d|<d	j|�|	d<q8d
|	d|<d|	d<n�td|d
t�}|}
x/|D]'}|j�|j�kr�|}
q�q�W||
dd}|sBd||
krB||
dd}qBn|r.tjjjd|ddd|�r�|r�dj|�|	d|<dj|
|�|	d<q+dj||�|	d<q8tjjjd|ddd|�rdj||�|	d|<dj|
||�|	d<q8dj||�|	d<n
d|	d<|	dsF|	St	dr^d+|	d<|	Stdd|d |d!|d"|d#|d$|d%|d&|d'|�	}d(|kr�d)j|�|	d<t|	d<nd*j|�|	d<t|	d<tddt�}tjjj
|
|�|	d<|	S(,u�
    Upgrades a package. Will install the package if not installed.

    .. versionadded:: 2018.3.0

    Args:

        name (str):
            The name of the package to be installed. Required.

        version (str):
            Install a specific version of the package. Defaults to latest
            version. If the version is greater than the one installed then the
            specified version will be installed. Default is ``None``.

        source (str):
            Chocolatey repository (directory, share or remote URL, feed).
            Defaults to the official Chocolatey feed. Default is ``None``.

        force (bool):
            ``True`` will reinstall an existing package with the same version.
            Default is ``False``.

        pre_versions (bool):
            ``True`` will nclude pre-release packages. Default is ``False``.

        install_args (str):
            Install arguments you want to pass to the installation process, i.e
            product key or feature list. Default is ``None``.

        override_args (bool):
            ``True`` will override the original install arguments (for the
            native installer) in the package and use those specified in
            ``install_args``. ``False`` will append install_args to the end of
            the default arguments. Default is ``False``.

        force_x86 (bool):
            ``True`` forces 32bit installation on 64 bit systems. Default is
            ``False``.

        package_args (str):
            Arguments you want to pass to the package. Default is ``None``.

    .. code-block:: yaml

        upgrade_some_package:
          chocolatey.upgraded:
            - name: packagename
            - version: '12.04'
            - source: 'mychocolatey/source'
    unameuresultuchangesuucommentuchocolatey.listRuVersion {0} will be installeduInstall version {0}u Latest version will be installeduInstall latest versionuchocolatey.versionR	u	installediu	availableRRu==R
uVersion {0} will be reinstalleduReinstall {0} {1}u{0} {1} is already installedu<u+Version {0} will be upgraded to Version {1}uUpgrade {0} {1} to {2}u${0} {1} (newer) is already installeduNo version found to installutestuchocolatey.upgradeRRR
RRRRRRuRunning chocolatey failedu!Package {0} upgraded successfullyu!Failed to upgrade the package {0}N(RRRRRRRRRRRRR R!(RRR
RRRRRRR"R#R$R%R&R'R(R)R*((s:/usr/lib/python2.7/site-packages/salt/states/chocolatey.pytupgradedsz<

1


	



	

(t__doc__t
__future__RRRtsalt.utils.dataRtsalt.utils.versionstsalt.exceptionsRRRRR+R0R1(((s:/usr/lib/python2.7/site-packages/salt/states/chocolatey.pyt<module>s"		�P

Zerion Mini Shell 1.0