Your IP : 216.73.216.213


Current Path : /opt/alt/python35/lib/python3.5/site-packages/sdnotify/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib/python3.5/site-packages/sdnotify/__pycache__/__init__.cpython-35.pyc



��Y-�@swddlZddlZddlZdZejd	krHdd�ZnddlZdd�ZGdd�d�ZdS)
�Nz0.3.2�cCs|S)N�)�xrr�B/opt/alt/python35/lib/python3.5/site-packages/sdnotify/__init__.py�_bsrcCstj|�dS)Nr)�codecs�latin_1_encode)rrrrrsc@s1eZdZdZddd�Zdd�ZdS)�SystemdNotifierz�This class holds a connection to the systemd notification socket
    and can be used to send messages to systemd using its notify method.Fc
Cs�||_ybtjtjtj�|_tjd�}|ddkrZd|dd�}|jj|�Wnd|_|jr��YnXdS)a�Instantiate a new notifier object. This will initiate a connection
        to the systemd notification socket.

        Normally this method silently ignores exceptions (for example, if the
        systemd notification socket is not available) to allow applications to
        function on non-systemd based systems. However, setting debug=True will
        cause this method to raise any exceptions generated to the caller, to
        aid in debugging.
        Z
NOTIFY_SOCKETr�@��N)�debug�socketZAF_UNIXZ
SOCK_DGRAM�os�getenvZconnect)�selfr
Zaddrrrr�__init__s
			zSystemdNotifier.__init__c	Cs5y|jjt|��Wn|jr,�YnXdS)a"Send a notification to systemd. state is a string; see
        the man page of sd_notify (http://www.freedesktop.org/software/systemd/man/sd_notify.html)
        for a description of the allowable values.

        Normally this method silently ignores exceptions (for example, if the
        systemd notification socket is not available) to allow applications to
        function on non-systemd based systems. However, setting debug=True will
        cause this method to raise any exceptions generated to the caller, to
        aid in debugging.N)rZsendallrr
)r�staterrr�notify-s

	zSystemdNotifier.notifyN)�__name__�
__module__�__qualname__�__doc__rrrrrrr	sr	)r)rr�sys�__version__�version_inforrr	rrrr�<module>s