← Back
Editing: inetdconf.cpython-38.pyc
U ��W[5 � @ s� d Z G dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG d d � d �ZG dd� d�ZG d d� de�ZG dd� de�Z dS )z Parser for inetd.conf files c @ s e Zd ZdZdS )�InvalidConfErrorz$ Invalid configuration file N��__name__� __module__�__qualname__�__doc__� r r �:/usr/lib/python3/dist-packages/twisted/runner/inetdconf.pyr s r c @ s e Zd ZdZdS )�InvalidInetdConfErrorz! Invalid inetd.conf file Nr r r r r r s r c @ s e Zd ZdZdS )�InvalidServicesConfErrorz Invalid services file Nr r r r r r s r c @ s e Zd ZdZdS )�UnknownServicez Unknown service name Nr r r r r r s r c @ s2 e Zd ZdZdZdZd dd�Zdd� Zdd � ZdS )�SimpleConfFilez� Simple configuration file parser superclass. Filters out comments and empty lines (which includes lines that only contain comments). To use this class, override parseLine or parseFields. �#Nc C s� d}|dkr"| j r"t| j d�}d}zJ|�� D ]<}|�| j�}|dkrP|d|� }|�� }|s^q,| �|� q,W 5 |rz|�� X dS )z� Parse a configuration file If file is None and self.defaultFilename is set, it will open defaultFilename and use it. FN�rT���)�defaultFilename�open�close� readlines�find�commentChar�strip� parseLine)�self�filer �lineZcommentr r r � parseFile3 s zSimpleConfFile.parseFilec C s<