%PDF- %PDF-
Direktori : /usr/lib/python3/dist-packages/cloudinit/distros/parsers/__pycache__/ |
Current File : //usr/lib/python3/dist-packages/cloudinit/distros/parsers/__pycache__/sys_conf.cpython-312.pyc |
� ���f? � �� � d dl Z d dlZd dlmZ d dlZdZ e j dez � e j d� e j d� gZd� Z G d� d ej � Z y) � N)�StringIOz[a-zA-Z_]+[a-zA-Z0-9_]*z\$z\$[0-9#\?\-@\*]z\$\{.+\}c �@ � t D ] }|j | � s� y y)NTF)�SHELL_VAR_REGEXES�search)�text�rs �D/usr/lib/python3/dist-packages/cloudinit/distros/parsers/sys_conf.py�_contains_shell_variabler $ s$ � � � ���8�8�D�>��� � c �* � e Zd ZdZd� Zd� Zdd�Zd� Zy)�SysConfa A configobj.ConfigObj subclass specialised for sysconfig files. :param contents: The sysconfig file to parse, in a format accepted by ``configobj.ConfigObj.__init__`` (i.e. "a filename, file like object, or list of lines"). c �J � t j j | |dd�� y )NFT)� interpolation�write_empty_values)� configobj� ConfigObj�__init__)�self�contentss r r zSysConf.__init__4 s$ � ����$�$��(�%�D� %� r c � � | j � }t � }t |t t f� r0|j dj |� � |j � S |j t |� � |j � S )N� )�writer � isinstance�list�tuple�join�str�getvalue)r r �out_contentss r �__str__zSysConf.__str__9 sm � ��:�:�<���z���h��u� �.����t�y�y��2�3� �$�$�&�&� ���s�8�}�-��$�$�&�&r c �� � � t |t � st d|z � �t |� dk( ryd }|d dv r|d dv rt |� dk( r�� fd�}n�|j � j d� r |j � j d � rnSt j d |� r=t |� r"t j d|� r� fd�}n� fd �}nt j }|s|S ||� S )NzValue "%s" is not a stringr � )�"�'���� c �, �� �j | � | z S �N��_get_single_quote��xr s �r �<lambda>z SysConf._quote.<locals>.<lambda>K s �� �d�4�4�Q�7�!�;� r z$(�)z [\t\r\n ]z[\n\"']c �, �� �j | � | z S r( )�_get_triple_quoter+ s �r r- z SysConf._quote.<locals>.<lambda>Y � �� �$�*@�*@��*C�a�*G� r c �, �� �j | � | z S r( r) r+ s �r r- z SysConf._quote.<locals>.<lambda>] r1 r )r r � ValueError�len�strip� startswith�endswith�rer r �shlex�quote)r �value� multiline� quot_funcs ` r �_quotezSysConf._quoteB s� �� ��%��%��9�U�C�D�D��u�:��?��� ���8�z�!�e�B�i�:�&=��5�z�Q��;� � �{�{�}�'�'��-�%�+�+�-�2H�2H��2M���9�9�\�5�1�/��6� �9�9�Z��7� G� &� !H� &� %*�K�K� ���L����r c � � | j | j |� � }| j | j |� � }| j |� }|�|�d�|�|��S )N�=)�_decode_elementr>