%PDF- %PDF-
Mini Shell

Mini Shell

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

�
���^c@@s�dZddlmZmZddlZddlmZy/ddlZejd�j	ej
�eZWne
k
r�eZnXeje�ZdZd�Zd�Zd	�ZdS(
uM
Beacon to emit Telegram messages

Requires the python-telegram-bot library

i(tabsolute_importtunicode_literalsN(tmaputelegramutelegram_bot_msgcC@str
tStSdS(N(tHAS_TELEGRAMt__virtualname__tFalse(((sA/usr/lib/python2.7/site-packages/salt/beacons/telegram_bot_msg.pyt__virtual__sc@s�t|t�stdfSi�tt�j|��t�fd�ddgD��satdfSt�jd�t�s�tdfStdfS(u+
    Validate the beacon configuration
    u9Configuration for telegram_bot_msg beacon must be a list.c3@s|]}�j|�VqdS(N(tget(t.0trequired_config(t_config(sA/usr/lib/python2.7/site-packages/salt/beacons/telegram_bot_msg.pys	<genexpr>.sutokenuaccept_fromu<Not all required configuration for telegram_bot_msg are set.uLConfiguration for telegram_bot_msg, accept_from must be a list of usernames.uValid beacon configuration.(t
isinstancetlistRRtupdatetallRtTrue(tconfig((R
sA/usr/lib/python2.7/site-packages/salt/beacons/telegram_bot_msg.pytvalidate#s


c	C@sTi}tt|j|��tjd�g}i}g|d<tj|d�}|jdddddd	�}tjd
t|��|s�tjd�|Sd}xb|D]Z}|j	}|j
|kr�|j
}n|jj|dkr�|dj
|j��q�q�W|jd
|d�tjdt|d��|drP|j
|�n|S(uU
    Emit a dict with a key "msgs" whose value is a list of messages
    sent to the configured bot by one of the allowed usernames.

    .. code-block:: yaml

        beacons:
          telegram_bot_msg:
            - token: "<bot access token>"
            - accept_from:
              - "<valid username>"
            - interval: 10

    u telegram_bot_msg beacon startingumsgsutokentlimitidttimeoutit
network_delayi
uNum updates: %du'Telegram Bot beacon has no new messagesuaccept_fromtoffsetiuEmitting %d messages.(RRR
tlogtdebugttelegramtBottget_updatestlentmessaget	update_idtchattusernametappendtto_dict(	RR
trettoutputtbottupdatestlatest_update_idR
R((sA/usr/lib/python2.7/site-packages/salt/beacons/telegram_bot_msg.pytbeacon:s0



	
(t__doc__t
__future__RRtloggingtsalt.ext.six.movesRRt	getLoggertsetLeveltCRITICALRRtImportErrorRt__name__RRRRR'(((sA/usr/lib/python2.7/site-packages/salt/beacons/telegram_bot_msg.pyt<module>s


		

Zerion Mini Shell 1.0