MOON
Server: Apache
System: Linux s5.yayogua.com.py 6.12.0-124.55.3.el10_1.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 7 16:54:02 EDT 2026 x86_64
User: sanbercountryclu (1012)
PHP: 8.2.33
Disabled: NONE
Upload Files
File: //lib/python3.12/site-packages/pyynl/__pycache__/ynl_gen_rst.cpython-312.pyc
�

�j�	��4�dZddlZddlZddlZddlZddlZejjeje
�j�jj��ddlmZdej fd�Zdededdfd�Zdd	�Zed
k(re�yy)a�
    Script to auto generate the documentation for Netlink specifications.

    :copyright:  Copyright (C) 2023  Breno Leitao <leitao@debian.org>
    :license:    GPL Version 2, June 1991 see linux/COPYING for details.

    This script performs extensive parsing to the Linux kernel's netlink YAML
    spec files, in an effort to avoid needing to heavily mark up the original
    YAML file. It uses the library code from scripts/lib.
�N)�YnlDocGenerator�returnc��tjd��}|jddd��|jddd	�
�|j�}|jddd
�
�|j	�}|j
r$t
jtj��|jr^tjj|j�s5t
jd|j�tjd�|j s*t
j"d�tjd�tjj|j �r t
j$d|j �|S)zParse arguments from userzNetlink RST generator)�descriptionz-vz	--verbose�
store_true)�actionz-oz--outputzOutput file name)�helpz-iz--inputzYAML file name)�levelz%s is not a valid file.���zNo output file specified.z"%s already exists. Overwriting it.)�argparse�ArgumentParser�add_argument�add_mutually_exclusive_group�
parse_args�verbose�logging�basicConfig�DEBUG�input�os�path�isfile�warning�sys�exit�output�error�debug)�parser�group�argss   �6/usr/lib/python3.12/site-packages/pyynl/ynl_gen_rst.py�parse_argumentsr#s��
�
$�
$�1H�
I�F�
����k�,��?�
����j�/A��B�
�/�/�1�E�	���t�Y�-=��>�����D��|�|����'�-�-�0��z�z�"�'�'�.�.����4����1�4�:�:�>�������;�;��
�
�1�2������	�w�w�~�~�d�k�k�"��
�
�:�D�K�K�H��K��content�filenamec��tjd|�t|dd��5}|j|�ddd�y#1swYyxYw)z,Write the generated content into an RST filezSaving RST file to %s�wzutf-8)�encodingN)rr�open�write)r%r&�rst_files   r"�write_to_rstfiler-7s7���M�M�)�8�4�	
�h��g�	.�(����w��
/�	.�	.�s�A�A	c���t�}t�}|jrptjd|j�	|jtjj|j��}t|j�yy#t$rT}tjd|j�tj|�tjd�Yd}~�pd}~wwxYw)zCMain function that reads the YAML files and generates the RST filesz
Parsing %szFailed to parse %s.rN)r#rrrr�parse_yaml_filerr�join�	Exceptionrrrr-r)r!rr%�	exceptions    r"�mainr3?s�����D�
�
�F��z�z��
�
�l�D�J�J�/�	��,�,�R�W�W�\�\�$�*�*�-E�F�G�	��$�+�+�.����	��O�O�1�4�:�:�>��O�O�I�&��H�H�R�L�L��	�s�8B�	C/�A
C*�*C/�__main__)rN)�__doc__�os.pathr�pathlibrrrr�append�Path�__file__�resolve�parent�as_posix�libr�	Namespacer#�strr-r3�__name__�r$r"�<module>rCs���
	���
������������X�&�.�.�0�7�7�@�@�B�C����+�+��< �c� �S� �T� �/�&�z���F�r$