Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/twisted/python/__pycache__/systemd.cpython-39.pyc
Ðазад
a k�h� � @ s@ d Z dgZddlmZ ddlmZmZmZmZ G dd� d�Z dS )z� Integration with systemd. Currently only the minimum APIs necessary for using systemd's socket activation feature are supported. � ListenFDs� )�getpid)�Iterable�List�Mapping�Optionalc @ sb e Zd ZdZdZee dd�dd�Zed e e eef e e d d�dd ��Ze e d �dd�ZdS )r aM L{ListenFDs} provides access to file descriptors inherited from systemd. Typically L{ListenFDs.fromEnvironment} should be used to construct a new instance of L{ListenFDs}. @cvar _START: File descriptors inherited from systemd are always consecutively numbered, with a fixed lowest "starting" descriptor. This gives the default starting descriptor. Since this must agree with the value systemd is using, it typically should not be overridden. @ivar _descriptors: A C{list} of C{int} giving the descriptors which were inherited. � N)�descriptors�returnc C s || _ dS )z @param descriptors: The descriptors which will be returned from calls to C{inheritedDescriptors}. N)�_descriptors)�selfr � r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/twisted/python/systemd.py�__init__% s zListenFDs.__init__)�environ�startr c C s� |du rddl m} |}|du r&| j}g }zt|d �}W n ttfyP Y nR0 |t� kr�zt|d �}W n ttfy� Y n 0 tt||| ��}|d= |d= | |�S )a� @param environ: A dictionary-like object to inspect to discover inherited descriptors. By default, L{None}, indicating that the real process environment should be inspected. The default is suitable for typical usage. @param start: An integer giving the lowest value of an inherited descriptor systemd will give us. By default, L{None}, indicating the known correct (that is, in agreement with systemd) value will be used. The default is suitable for typical usage. @return: A new instance of C{cls} which can be used to look up the descriptors which have been inherited. Nr )r Z LISTEN_PIDZ LISTEN_FDS) �osr �_START�int�KeyError� ValueErrorr �list�range)�clsr r �_environr �pid�countr r r �fromEnvironment, s$ zListenFDs.fromEnvironment)r c C s t | j�S )z6 @return: The configured descriptors. )r r )r r r r �inheritedDescriptorsY s zListenFDs.inheritedDescriptors)NN)�__name__� __module__�__qualname__�__doc__r r r r �classmethodr r �strr r r r r r r r s ��,N) r"