%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python2.7/site-packages/salt/thorium/
Upload File :
Create Path :
Current File : //lib/python2.7/site-packages/salt/thorium/reg.pyc

�
���^c@`sdZddlmZmZmZmZddlZidd6dd6Zd�Z	e
dd	�Zd
�Zd�Z
d�ZdS(
u�
Used to manage the thorium register. The thorium register is where compound
values are stored and computed, such as averages etc.
i(tabsolute_importtdivisiontprint_functiontunicode_literalsNusetuset_ulistulist_cC`s�i|d6id6dd6td6}|tkrLit|<t�t|d<nx�tD]�}tjjj|d|�rSy|ddj|�}Wn$t	k
r�|dj|�}nX|d
kr�d	}n||d|<t|dj|�qSqSW|S(u�
    Add a value to the named set

    USAGE:

    .. code-block:: yaml

        foo:
          reg.set:
            - add: bar
            - match: my/custom/event
    unameuchangesuucommenturesultuvalutagudatauNoneN(tTruet__reg__tsett
__events__tsalttutilststringutilst
expr_matchtgettKeyErrortNonetadd(tnameRtmatchtretteventtval((s4/usr/lib/python2.7/site-packages/salt/thorium/reg.pytset_s$




	c
C`sai|d6id6dd6td6}t|t�sC|jd�}n|tkrjit|<gt|d<nx�tD]�}y|dd}Wntk
r�|d}nXtjj	j
|d	|�rqi}xL|D]D}	|	|kr�||	||	<|tkr|dd
|d<qq�q�Wt|dj|�qqqqW|dkr]t|d| t|d<n|S(
u�
    Add the specified values to the named list

    If ``stamp`` is True, then the timestamp from the event will also be added
    if ``prune`` is set to an integer higher than ``0``, then only the last
    ``prune`` values will be kept in the list.

    USAGE:

    .. code-block:: yaml

        foo:
          reg.list:
            - add: bar
            - match: my/custom/event
            - stamp: True
    unameuchangesuucommenturesultu,uvaludatautagu_stamputimei(Rt
isinstancetlisttsplitRRR
RR	R
Rtappend(
RRRtstamptpruneRRt
event_datatitemtkey((s4/usr/lib/python2.7/site-packages/salt/thorium/reg.pytlist_2s2





cC`sIi|d6id6dd6td6}|tkreit|<dt|d<dt|d<dt|d	<nx�tD]�}y|d
d
}Wntk
r�|d
}nXtjjj|d|�rl||kr�yt|�}Wq�t	k
r�qlq�Xnt|dc|7<t|d	cd7<t|dt|d	t|d<qlqlW|S(
uE
    Accept a numeric value from the matched events and store a running average
    of the values in the given register. If the specified value is not numeric
    it will be skipped

    USAGE:

    .. code-block:: yaml

        foo:
          reg.mean:
            - add: data_field
            - match: my/custom/event
    unameuchangesuucommenturesultiuvalutotalucountudatautagi(
RRRR
RR	R
Rtintt
ValueError(RRRRRRtcomp((s4/usr/lib/python2.7/site-packages/salt/thorium/reg.pytmean_s0






)cC`sCi|d6id6dd6td6}|tkr?t|j�n|S(u�
    Clear the namespace from the register

    USAGE:

    .. code-block:: yaml

        clearns:
          reg.clear:
            - name: myregister
    unameuchangesuucommenturesult(RRtclear(RR((s4/usr/lib/python2.7/site-packages/salt/thorium/reg.pyR$�s

cC`s<i|d6id6dd6td6}|tkr8t|=n|S(u�
    Delete the namespace from the register

    USAGE:

    .. code-block:: yaml

        deletens:
          reg.delete:
            - name: myregister
    unameuchangesuucommenturesult(RR(RR((s4/usr/lib/python2.7/site-packages/salt/thorium/reg.pytdelete�s


(t__doc__t
__future__RRRRtsalt.utils.stringutilsRt__func_alias__RtFalseRR#R$R%(((s4/usr/lib/python2.7/site-packages/salt/thorium/reg.pyt<module>s"
	!-	)	

Zerion Mini Shell 1.0