
­­­­­­­­­­­­­­­­­­
<!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 )	SystemdNotifierzThis 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   

