
Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­
<!DOCTYPE html>
<html>
U
    ¾‚Y-  ã                   @   sR   d dl Z d dlZd dlZdZejdk r0dd„ Znd dlZdd„ ZG dd„ dƒZdS )	é    Nz0.3.2)é   c                 C   s   | S )N© ©Úxr   r   úB/opt/alt/python38/lib/python3.8/site-packages/sdnotify/__init__.pyÚ_b   s    r   c                 C   s   t  | ¡d S )Nr   )ÚcodecsÚlatin_1_encoder   r   r   r   r      s    c                   @   s"   e Zd ZdZddd„Zdd„ ZdS )	Ú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                 C   sn   || _ zHt tjtj¡| _t d¡}|d dkr@d|dd…  }| j |¡ W n   d| _| j rd‚ Y nX dS )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ÚsocketZAF_UNIXZ
SOCK_DGRAMÚosÚgetenvZconnect)Úselfr   Zaddrr   r   r   Ú__init__   s    

zSystemdNotifier.__init__c                 C   s.   z| j  t|ƒ¡ W n   | jr$‚ Y nX dS )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)r   Zsendallr   r   )r   Ústater   r   r   Únotify-   s
    
zSystemdNotifier.notifyN)F)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r
      s   
r
   )r   r   ÚsysÚ__version__Úversion_infor   r   r
   r   r   r   r   Ú<module>   s   

