%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/bower.pyo

�
���^c@@s�dZddlmZmZmZddlmZmZddlm	Z	d�Z
d
d
d
d�Zd
d�Z
d
d�Zd
d
d	�Zd
S(u�
Installation of Bower Packages
==============================

These states manage the installed packages using Bower.
Note that npm, git and bower must be installed for these states to be
available, so bower states should include requisites to pkg.installed states
for the packages which provide npm and git (simply ``npm`` and ``git`` in most
cases), and npm.installed state for the package which provides bower.

Example:

.. code-block:: yaml

    npm:
      pkg.installed
    git:
      pkg.installed
    bower:
      npm.installed
      require:
        - pkg: npm
        - pkg: git

    underscore:
      bower.installed:
        - dir: /path/to/project
        - require:
          - npm: bower
i(tabsolute_importtprint_functiontunicode_literals(tCommandExecutionErrortCommandNotFoundError(tsixcC@sdtkrdStS(u@
    Only load if the bower module is available in __salt__
    u
bower.listubower(t__salt__tFalse(((s5/usr/lib/python2.7/site-packages/salt/states/bower.pyt__virtual__*scC@s�i|d6d d6dd6id6}|d k	r7|}n	|g}y#tdd|d|d	|�}Wn:ttfk
r�}t|d<d
j||�|d<|SXtd�tj|�D��}g}	g}
x�|D]�}|j	d�\}}
}|j
�}||kr|
j|�q�n||kr�||}|jd
�jd�}dj||�}|r�||kr}|
j|�q�|	j|�q�q�|	j|�q�q�q�Wt
drLd |d<g}|
r|jdjdj|
���igd6|
d6|d<n|	r5|jdjdj|�dj|	���ndj|�|d<|S|
s�t|d<djdj|�dj|	��|d<|Sy`id d6|d6d d6|d6|d6}|d k	r�||d<n
||d<td|�}WnCttfk
r-}t|d<djdj|�|�|d<|SX|rut|d<igd6|
d6|d<djdj|
��|d<n&t|d<djdj|��|d<|S(!u,
    Verify that the given package is installed and is at the correct version
    (if specified).

    .. code-block:: yaml

        underscore:
          bower.installed:
            - dir: /path/to/project
            - user: someuser

        jquery#2.0:
          bower.installed:
            - dir: /path/to/project

    name
        The package to install

    dir
        The target directory in which to install the package

    pkgs
        A list of packages to install with a single Bower invocation;
        specifying this argument will ignore the ``name`` argument

    user
        The user to run Bower with

    env
        A list of environment variables to be set prior to execution. The
        format is the same as the :py:func:`cmd.run <salt.states.cmd.run>`.
        state function.

    unameuresultuucommentuchangesu
bower.listtdirtrunastenvuError looking up '{0}': {1}cs@s!|]\}}||fVqdS(N((t.0tptinfo((s5/usr/lib/python2.7/site-packages/salt/states/bower.pys	<genexpr>fsu#upkgMetauversionu{0}#{1}utestu.Bower package(s) '{0}' are set to be installedu, uoldunewu!Package(s) '{0}' satisfied by {1}u. upkgudirupkgsurunasuenvu
bower.installuError installing '{0}': {1}u'Package(s) '{0}' successfully installedu"Could not install package(s) '{0}'N(tNoneRRRRtformattdictRt	iteritemst	partitiontstriptappendtgett__opts__tjointTrue(tnameR	tpkgstuserRtrettpkg_listtinstalled_pkgsterrtpkgs_satisfiedtpkgs_to_installtpkgtpkg_namet_tpkg_vert
installed_pkgtinstalled_pkg_vertinstalled_name_vertcomment_msgtcmd_argstcall((s5/usr/lib/python2.7/site-packages/salt/states/bower.pyt	installed1s�'"		#
	


	




"
"





cC@s�i|d6dd6dd6id6}ytdd|d|�}Wn:ttfk
r{}t|d<d	j||�|d<|SX||kr�t|d<d
j|�|d<|Stdr�d|d<dj|�|d<|Syqtd
d|d|d|�r't|d<id|6|d<dj|�|d<nt|d<dj|�|d<Wn9ttfk
r�}t|d<d	j||�|d<nX|S(u�
    Verify that the given package is not installed.

    dir
        The target directory in which to install the package

    user
        The user to run Bower with

    unameuresultuucommentuchangesu
bower.listR	R
uError removing '{0}': {1}uPackage '{0}' is not installedutestu"Package '{0}' is set to be removedubower.uninstallR#uRemovedu&Package '{0}' was successfully removeduError removing '{0}'N(RRRRRRRR(RR	RRRR ((s5/usr/lib/python2.7/site-packages/salt/states/bower.pytremoved�s6"






cC@s�i|d6dd6dd6id6}tdrMd|d<dj|�|d<|Sy#tdd	dd
|d|�}Wn:ttfk
r�}t|d<dj||�|d<|SX|s�t|d<d
|d<|St|d<id|6|d<d|d<|S(u�
    Bootstraps a frontend distribution.

    Will execute 'bower install' on the specified directory.

    user
        The user to run Bower with

    unameuresultuucommentuchangesutestu)Directory '{0}' is set to be bootstrappedu
bower.installR#R	R
uError bootstrapping '{0}': {1}u!Directory is already bootstrappeduBootstrappedu'Directory was successfully bootstrappedN(RRRRRRRR(RRRR,R ((s5/usr/lib/python2.7/site-packages/salt/states/bower.pyt	bootstrap�s(
"


#




cC@si|d6dd6dd6id6}tdrMd|d<dj|�|d<|Sy#tdd	|d
|d|�}Wn:ttfk
r�}t|d<dj||�|d<|SXt|d<|r�d
j|�|d<igd6|d6|d<ndj|�|d<|S(u�
    .. versionadded:: 2017.7.0

    Cleans up local bower_components directory.

    Will execute 'bower prune' on the specified directory (param: name)

    user
        The user to run Bower with

    unameuresultuucommentuchangesutestu#Directory '{0}' is set to be prunedubower.pruneR	R
RuError pruning '{0}': {1}u'Directory '{0}' was successfully pruneduoldunewu,No packages were pruned from directory '{0}'N(RRRRRRRR(RRRRR,R ((s5/usr/lib/python2.7/site-packages/salt/states/bower.pytpruneds$"


#

N(t__doc__t
__future__RRRtsalt.exceptionsRRtsalt.extRRRR-R.R/R0(((s5/usr/lib/python2.7/site-packages/salt/states/bower.pyt<module>s		�.%

Zerion Mini Shell 1.0