%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/ifttt.pyc

�
���^c@@s�dZddlmZmZmZddlZddlZddlZddl	Zej
e�Zd�Z
dddddd�Zdd�ZdS(u�
Support for IFTTT

.. versionadded:: 2015.8.0

Requires an ``api_key`` in ``/etc/salt/minion``:

.. code-block: yaml

    ifttt:
      secret_key: '280d4699-a817-4719-ba6f-ca56e573e44f'
i(tabsolute_importtprint_functiontunicode_literalsNcC@s0tdd�r,tdd�r,tdfStS(u5
    Only load the module if apache is installed
    u
config.getuifttt.secret_keyuifttt:secret_keyu*IFTTT Secret Key Unavailable, not loading.(t__salt__tFalsetTrue(((s6/usr/lib/python2.7/site-packages/salt/modules/ifttt.pyt__virtual__s
uGETcC@s�tdd�ptdd�}dj||�}|dkrNidd6}n|dkrgd|d<ntjjj||d	id
|d|dtd
ddtdtdtdtdtdd�}|S(u#
    Make a web call to IFTTT.
    u
config.getuifttt.secret_keyuifttt:secret_keyu0https://maker.ifttt.com/trigger/{0}/with/key/{1}uapplication/jsonuContent-typeuPOSTuAccepttparamstdatatheader_dicttdecodetdecode_typeuautottexttstatustcookiestpersist_sessiontoptstbackendurequestsN(	RtformattNonetsalttutilsthttptqueryRt__opts__(teventtmethodtargsR	Rt
secret_keytpathtresult((s6/usr/lib/python2.7/site-packages/salt/modules/ifttt.pyt_query%s,
	cK@s�itd6dd6}i}x1dD])}||kr!||||j�<q!q!Wtjd
tj��|d<td|d
ddtjjj	|��}d|kr�|ddkr�t
|d<|d|d<q�d|kr�|d|d<q�n|S(u�
    Trigger a configured event in IFTTT.

    :param event:   The name of the event to trigger.

    :return:        A dictionary with status, text, and error if result was failure.
    uresultuSomething went wrongumessageuvalue1uvalue2uvalue3uValue1uValue2uValue3u%B %d, %Y %I:%M%pu
occurredatRRuPOSTRustatusi�utextuerror(uvalue1uvalue2uvalue3uValue1uValue2uValue3(Rtlowerttimetstrftimet	localtimeRRRtjsontdumpsR(RtkwargstresRtvalueR((s6/usr/lib/python2.7/site-packages/salt/modules/ifttt.pyt
trigger_eventIs"	

(t__doc__t
__future__RRRtloggingR!tsalt.utils.httpRtsalt.utils.jsont	getLoggert__name__tlogRRRR)(((s6/usr/lib/python2.7/site-packages/salt/modules/ifttt.pyt<module>
s	
 

Zerion Mini Shell 1.0