관리-도구
편집 파일: __init__.cpython-311.pyc
� M�Dg- � �h � d dl Z d dlZd dlZdZej dk rd� Znd dlZd� Z G d� d� � ZdS )� Nz0.3.2)� c � � | S )N� ��xs �q/builddir/build/BUILD/imunify360-venv-2.4.0/opt/imunify360/venv/lib/python3.11/site-packages/sdnotify/__init__.py�_br s � ��� c �6 � t j | � � d S )Nr )�codecs�latin_1_encoder s r r r s � ��$�Q�'�'��*�*r c � � e Zd ZdZdd�Zd� 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 �. � || _ t j t j t j � � | _ t j d� � }|d dk r d|dd� z }| j � |� � dS # d| _ | j r� Y dS xY w)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. � NOTIFY_SOCKETr �@� � N)�debug�socket�AF_UNIX� SOCK_DGRAM�os�getenv�connect)�selfr �addrs r �__init__zSystemdNotifier.__init__ s� � � �� � � �-����8I�J�J�D�K��9�_�-�-�D��A�w�#�~�~��d�1�2�2�h����K����%�%�%�%�%�� ��D�K��z� �� � � ���s �A5B � Bc �v � | j � t |� � � � dS # | j r� Y dS xY w)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 �sendallr r )r �states r �notifyzSystemdNotifier.notify- sN � � ��K����5� � �*�*�*�*�*�� ��z� �� � � ���s �'+ � 8N)F)�__name__� __module__�__qualname__�__doc__r r"