File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/__pycache__/pushbullet.cpython-310.pyc
Back
o ;j� � @ sb d Z ddlZzddlZdZW n ey dZY nw e�e�Zdd� ZG dd� d�Z dd d �Z dS )a| Module for sending messages to Pushbullet (https://www.pushbullet.com) .. versionadded:: 2015.8.0 Requires an ``api_key`` in ``/etc/salt/minion``: .. code-block:: yaml pushbullet: api_key: 'ABC123abc123ABC123abc123ABC123ab' For example: .. code-block:: yaml pushbullet: device: "Chrome" title: "Example push message" body: "Message body." � NTFc C s( t sdS td d�std d�sdS dS )N)FzMissing pushbullet library.� config.get�pushbullet.api_key�pushbullet:api_key)Fz,Pushbullet API Key Unavailable, not loading.T)�HAS_PUSHBULLET�__salt__� r r �K/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/pushbullet.py�__virtual__$ s �r c @ s$ e Zd Zdd� Zdd� Zdd� ZdS )�_SaltPushbulletc C s4 t d d�pt d d�}t�|�| _| �|�| _d S )Nr r r )r � pushbulletZ Pushbullet�pb�_find_device_by_name�target)�selfZdevice_nameZapi_keyr r r �__init__/ s ��z_SaltPushbullet.__init__c C s | j j||| jd�}|S )N)�device)r � push_noter )r �title�body�pushr r r r 6 s z_SaltPushbullet.push_notec C s$ | j jD ]}|j|kr| S qd S )N)r ZdevicesZnickname)r �name�devr r r r : s ��z$_SaltPushbullet._find_device_by_nameN)�__name__� __module__�__qualname__r r r r r r r r . s r c C s t | �}|�||�}|S )a] Pushing a text note. :param device: Pushbullet target device :param title: Note title :param body: Note body :return: Boolean if message was sent successfully. CLI Example: .. code-block:: bash salt "*" pushbullet.push_note device="Chrome" title="Example title" body="Example body." )r r )r r r Zspb�resr r r r @ s r )NNN)�__doc__�loggingr r �ImportError� getLoggerr �logr r r r r r r �<module> s �
| ver. 1.4 |
Github
|
.
| PHP 8.2.30 | Generation time: 0 |
proxy
|
phpinfo
|
Settings