403Webshell
Server IP : 88.99.149.37  /  Your IP : 216.73.216.141
Web Server : nginx/1.31.2
System : Linux server-88-99-149-37 6.12.0-124.56.5.el10_1.x86_64 #1 SMP PREEMPT_DYNAMIC Fri May 15 06:12:08 EDT 2026 x86_64
User : muralimurth ( 1015)
PHP Version : 8.4.23
Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3.12/site-packages/pyynl/lib/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3.12/site-packages/pyynl/lib/__pycache__/doc_generator.cpython-312.pyc
�

�bj6;��z�dZddlmZmZmZddlZdZGd�dej�ZGd�d�Z	Gd	�d
�Z
y)a:
    Class 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 class 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.

    This code is split in two classes:
        1) RST formatters: Use to convert a string to a RST output
        2) YAML Netlink (YNL) doc generator: Generate docs from YAML data
�)�Any�Dict�ListN�
__lineno__c�"��eZdZdZ�fd�Z�xZS)�NumberedSafeLoaderz?Override the SafeLoader class to add line number to parsed datac�h��t�|�|g|��i|��}|jj|t<|S�N)�super�construct_mapping�
start_mark�line�LINE_STR)�self�node�args�kwargs�mapping�	__class__s     ��</usr/lib/python3.12/site-packages/pyynl/lib/doc_generator.pyrz$NumberedSafeLoader.construct_mappings5����'�+�D�B�4�B�6�B�� �O�O�0�0������)�__name__�
__module__�__qualname__�__doc__r�
__classcell__)rs@rrrs���I��rrc	��eZdZdZdZededefd��Zededefd��Z	ededefd��Z
ededefd	��Zd%d
edededefd�Zd%d
ede
dedefd
�Zd%dededefd�Zd%dededefd�Zededefd��Zededefd��Zededededefd��Zededefd��Zededefd��Zd%deededefd�Zededededefd��Zdefd�Zed&dedefd ��Zededefd!��Zed"edefd#��Zy$)'�
RstFormatterszRST Formatters��level�returnc�.�d|tjzzS)zReturn space to format� )r�SPACE_PER_LEVEL)r s r�headroomzRstFormatters.headroom's���e�m�;�;�;�<�<r�textc��d|�d�S)zFormat bold textz**��r&s r�boldzRstFormatters.bold,����D�6��}�rc��d|�d�S)zFormat inline textz``r(r)s r�inlinezRstFormatters.inline1r+rc�T�t|�jdd�j�S)z#Remove newlines and multiple spaces�
r#)�str�replace�stripr)s r�sanitizezRstFormatters.sanitize6s$���4�y� � ��s�+�1�1�3�3r�key�valuec�6�|j|�d|�d|��zS)zReturn a RST formatted field�:z: �r%�rr4r5r s    r�
rst_fieldszRstFormatters.rst_fields<s#���}�}�U�#��#��b���&8�8�8rc�r�|j|�|zdz|j|dz�zt|�zS)zFormat a single rst definitionr/�)r%r0r9s    r�rst_definitionzRstFormatters.rst_definition@s7���}�}�U�#�c�)�D�0�4�=�=����3K�K�c�RW�j�X�Xr�	paragraphc�*�|j|�|zS)zReturn a formatted paragraphr8)rr>r s   r�
rst_paragraphzRstFormatters.rst_paragraphDs���}�}�U�#�i�/�/r�itemc�0�|j|�d|��zS)zReturn a formatted a bulletz- r8)rrAr s   r�
rst_bulletzRstFormatters.rst_bulletHs���}�}�U�#��4�&�k�1�1r�titlec�*�|�d�dt|�zzS)z!Add a sub-section to the documentr/�-��len�rDs r�rst_subsectionzRstFormatters.rst_subsectionL������|�c�C��J�.�.�.rc�*�|�d�dt|�zzS)z%Add a sub-sub-section to the documentr/�~rGrIs r�rst_subsubsectionzRstFormatters.rst_subsubsectionQrKr�	namespace�prefixc	�>�d|�d|�d|�d|�d�	dt|�zzS)zAdd a section to the document�.. _rF�:

r/�=rG)rOrPrDs   r�rst_sectionzRstFormatters.rst_sectionVs3���i�[��&���5�'��u�g�R�@�3��U��CS�S�Src�V�ddt|�zzd|�d�zdt|�zzdzS)zAdd a subtitle to the documentr/rF�

rGrIs r�rst_subtitlezRstFormatters.rst_subtitle[s8���c�C��J�&�&�2�e�W�B��7�#��E�
�:J�J�V�S�Src�P�dt|�zd|�d�zdt|�zzdzS)zAdd a title to the documentrTr/rWrGrIs r�	rst_titlezRstFormatters.rst_title`s3���S��Z��B�u�g�R�.�0�3��U��3C�C�f�L�Lr�list_c�h���j|�dzdj�fd�|D��zdzS)zFormat a list using inlines�[z, c3�@�K�|]}�j|����y�wr
)r-)�.0�irs  �r�	<genexpr>z0RstFormatters.rst_list_inline.<locals>.<genexpr>gs�����5T�e��d�k�k�!�n�e�s��])r%�join)rr[r s`  r�rst_list_inlinezRstFormatters.rst_list_inlinees1����}�}�U�#�c�)�D�I�I�5T�e�5T�,T�T�WZ�Z�Zr�namec�:�ddddd�}||vr||}d|�d|�d|�d�S)zAdd a hyperlink to the document�
definition�
attribute-set)�enum�fixed-header�nested-attributes�structz:ref:`rF�`r()rOrPre�mappingss    r�rst_refzRstFormatters.rst_refisF��)�$0�)8�*�,���X���f�%�F��	�{�!�F�8�1�T�F�!�4�4rc��g}|j|jd��|j|jd��dj|�S)z0The headers for all the auto generated RST filesz#.. SPDX-License-Identifier: GPL-2.0z,.. NOTE: This document was auto-generated.

r/)�appendr@rc)r�liness  r�
rst_headerzRstFormatters.rst_headertsF����
���T�'�'�(M�N�O�
���T�'�'�(X�Y�Z��y�y���r�maxdepthc�t�g}|jd�|jd|�d��dj|�S)z Generate a toctree RST primitivez.. toctree::z   :maxdepth: rWr/)rqrc)rtrrs  r�rst_toctreezRstFormatters.rst_toctree}s9����
���^�$�
���~�h�Z�t�4�5��y�y���rc��d|�d�S)zReturn a formatted labelrRrSr(rIs r�	rst_labelzRstFormatters.rst_label�s���e�W�E�"�"r�linenoc��d|�d�S)zReturn a lineno commentz
.. LINENO r/r()rys r�
rst_linenozRstFormatters.rst_lineno�s���F�8�2�&�&rN�r)�)rrrrr$�staticmethod�intr0r%r*r-r3r:rr=r@rCrJrNrUrXrZrrdrorsrvrxr{r(rrrr"s�����O��=��=��=��=���3��3������S��S�����4�s�4�s�4��4�
9�c�9�#�9�c�9�#�9�Y�#�Y�c�Y�#�Y�c�Y�0�s�0�3�0�s�0�2�s�2�3�2�s�2��/�c�/�c�/��/��/��/��/��/��T�s�T�C�T��T��T��T��T�C�T�C�T��T��M��M��M��M�[�T�#�Y�[�s�[�3�[��5�3�5��5�3�5�3�5��5� �C� �� �c� �#� �� ��#��#��#��#��'�3�'�3�'��'rrc�V�eZdZdZe�Zdeeee	fdefd�Z
ddeee	fdedefd�Zddeee	fdedefd	�Z
d
eeee	fdedefd�Zd
eeee	fdedefd�Zdeee	fdedefd�Zd
eeee	fdedefd�Zd
eeee	fdedefd�Zdeee	fdefd�Zdedefd�Zy)�YnlDocGeneratorzYAML Netlink specs Parser�mcast_groupr!c��g}|D]/}|j|jj|d���1dj|�S)z:Parse 'multicast' group list and return a formatted stringrer/)rq�fmtrCrc)rr�rr�groups    r�parse_mcast_groupz!YnlDocGenerator.parse_mcast_group�sA���� �E��L�L����,�,�U�6�]�;�<�!��y�y���r�do_dictr c�0�g}t|vr1|j|jj|t��|j	�D]�}|tk(r�
|j|jj|jj
|�|dz��|dvr+|j|j|||dz�dz���|j|jj|dz�||zdz���dj|�S)z0Parse 'do' section and return a formatted stringr<)�request�replyr/r})
rrqr�r{�keysr@r*�parse_do_attributesr%rc)rr�r rrr4s     r�parse_dozYnlDocGenerator.parse_do�s������w���L�L����,�,�W�X�->�?�@��<�<�>�C��h����L�L����/�/����
�
�c�0B�E�A�I�N�O��*�*����T�5�5�g�c�l�E�A�I�N�QU�U�V����T�X�X�.�.�u�q�y�9�G�C�L�H�4�O�P�"��y�y���r�attrsc��d|vry|jjd|jj|d�|dz�g}dj|�S)zParse 'attributes' section�
attributes�r<r/)r�r:rdrc)rr�r rrs    rr�z#YnlDocGenerator.parse_do_attributes�sW���u�$�����$�$�\�%)�X�X�%=�%=�e�L�>Q�%R�%*�Q�Y�0�1���y�y���r�
operationsrOc
�j�gd�}ddg}g}|D�]}t|vr1|j|jj|t��|j|jj	|d|d��|j|jj|d�dz�|j
�D]c}|tk(r�
||vr�||}||vr|jj|||�}|j|jj||d���ed	|vrG|j|jjd	|jj|d	���d
|vrO|j|jjdd��|j|j|d
d��d|vrO|j|jjd
d��|j|j|dd��|jd���dj|�S)zParse operations block)re�docrD�do�dump�flagsrjrh�	operationrer�r/rr�r�z:do:r�z:dump:)rrqr�r{rUr@r�ror:rdr�rc)	rr�rO�preprocessed�linkablerrr�r4r5s	         r�parse_operationsz YnlDocGenerator.parse_operations�s���F��"�O�4����#�I��9�$����T�X�X�0�0��8�1D�E�F��L�L����-�-�i��.7��.?�A�
B��L�L����/�/�	�%�0@�A�D�H�I� �~�~�'���(�?���,�&��!�#����(�?� �H�H�,�,�Y��U�C�E����T�X�X�0�0��e�Q�?�@�(��)�#����T�X�X�0�0��15���1I�1I�)�T[�J\�1]�_�`��y� ����T�X�X�3�3�F�A�>�?����T�]�]�9�T�?�A�>�?���"����T�X�X�3�3�H�a�@�A����T�]�]�9�V�+<�a�@�A�
�L�L���?$�B�y�y���r�entriesc��dg}g}|D�]N}t|t�r�|jdd�}||vr�+|jd�}|r"|d|jj	|��d�z
}|j|jj
||jj|jdd��|����t|t�r,|j|jj||����|j|jj|jj	|jj|��|����Q|jd�dj|�S)	zParse a list of entries�padrer��type� (�)r�r/)�
isinstance�dict�getr�r-rqr:r3�listrdrCrc)rr�r �ignoredrr�entry�
field_name�type_s        r�
parse_entrieszYnlDocGenerator.parse_entries�s4���'�����E��%��&�"�Y�Y�v�r�2�
���(���	�	�&�)����B�t�x�x���u�'=�&>�a�"@�@�J�����H�H�'�'�
�(,���(9�(9�%�)�)�E�2�:N�(O�(-�/��
�E�4�(����T�X�X�5�5�e�U�C�D����T�X�X�0�0���������AR�AR�SX�AY�1Z�16�8�9�#�(	���T���y�y���r�defsc�h�gd�}dg}g}|D�]�}t|vr1|j|jj|t��|j|jj	|d|d��|j�D]\}|tk(r�
|||zvr�|j|jj
||jj||�d���^|jd�d|vrO|j|jjdd��|j|j|dd	��d
|vs��E|j|jjdd��|j|j|d
d	�����dj|�S)zParse definitions section)rer��membersz
render-maxrgrerr/r�z	:entries:r<r�z	:members:)rrqr�r{rUr�r:r3r@r�rc)rr�rOr�r�rrrg�ks        r�parse_definitionsz!YnlDocGenerator.parse_definitions�sn��5���.�����J��:�%����T�X�X�0�0��H�1E�F�G��L�L����-�-�i��z�RX�GY�Z�[��_�_�&����=����w�.�.�����T�X�X�0�0��D�H�H�4E�4E�j�QR�m�4T�VW�X�Y�'�
�L�L����J�&����T�X�X�3�3�K��C�D����T�/�/�
�9�0E�q�I�J��J�&����T�X�X�3�3�K��C�D����T�/�/�
�9�0E�q�I�J�'�*�y�y���rc
��ddg}gd�}dg}g}|D�]�}|j|jj|d|d��d|vr1|j|jj|dd�dz�|d	D�]G}t|vr1|j|jj|t��|j
d�}	|d}
|	r"|
d
|jj|	��d�z
}
|j|jj|
��|j�D]�}|tk(r�
|||zvr�||vr!|jj||||�}n|jj||�}|j|jj||d����|jd���J���dj|�S)z"Parse attribute from attribute-setrer�)rirkrl�sub-message�checksrhr�rr/r�r�r�)rqr�rUr@rr{r�r-rNr�ror3r:rc)
rr�rOr�r�r�rrr��attrr��	attr_liner�r5s
             r�parse_attr_setszYnlDocGenerator.parse_attr_setss�����'��I���*�����E��L�L����-�-�i��.3�F�m�=�
>���~����T�X�X�3�3�E�%�L�!�D�t�K�L��l�+���t�#��L�L����!4�!4�T�(�^�!D�E�����(�� ��L�	���2�d�h�h�o�o�e�&<�%=�Q�!?�?�I����T�X�X�7�7�	�B�C�����A��H�}� ��L�7�2�2� ��H�}� $��� 0� 0��A�t�A�w� G�� $��� 1� 1�$�q�'� :���L�L����!4�!4�Q��q�!A�B�%����T�"�-,��>�y�y���rc��g}|D]�}|j|jj|d|d��|dD]�}|d}|j|jj|jj	|���dD]Q}||vs�|j|jj||jj
||||�d���S|jd�����dj|�S)zParse sub-message definitionsr�re�formatsr5)rjrhr<r/)rqr�rUrCr*r:rorc)rr�rOrrr�r�r5r�s        r�parse_sub_messagesz"YnlDocGenerator.parse_sub_messagesBs������E��L�L����-�-�i��.3�F�m�=�
>��Y�'���G������T�X�X�0�0������u�1E�F�G�=�D��s�{����T�X�X�%8�%8��9=���9I�9I�)�JN�JM�d�)�:U�:;�	&<�=�>����T�"�(�� �y�y���r�objc��g}|jdd�}|j|jj|��|d}|j|jj	��|j|jjd|z��d|�d�}|j|jj
|��|j|jjd��d|vrX|j|jjd	��|j|jj|dd��d
|vrQ|j|jjd��|j|j|d
d|��d
|vrP|j|jjd��|j|j|d
d��d|vrN|j|jjd��|j|j|d|��d|vrN|j|jjd��|j|j|d|��d|vrN|j|jjd��|j|j|d|��dj|�S)z'Format the whole YAML into a RST stringrrreznetlink-z	Family ``z`` netlink specificationz.. contents:: :depth: 3
r��Summaryr��
Operationsr�zmcast-groupszMulticast groups�definitions�Definitionszattribute-setszAttribute setszsub-messageszSub-messagesr/)r�rqr�r{rsrxrZr@rXr�r�r�r�r�rc)rr�rrry�familyrDs      r�
parse_yamlzYnlDocGenerator.parse_yamlXsm��������q�)��
���T�X�X�(�(��0�1��V���
���T�X�X�(�(�*�+�
���T�X�X�'�'�
�V�(;�<�=��F�8�#;�<��
���T�X�X�'�'��.�/�
���T�X�X�+�+�,G�H�I��C�<��L�L����.�.�y�9�:��L�L����/�/��E�
�A�>�?��3���L�L����.�.�|�<�=��L�L��.�.�s�<�/@��/H�/5�7�
8��S� ��L�L����.�.�/A�B�C��L�L��/�/��N�0C�F�0K�L�M��C���L�L����.�.�}�=�>��L�L��/�/��M�0B�F�K�L��s�"��L�L����.�.�/?�@�A��L�L��-�-�c�2B�.C�V�L�M��S� ��L�L����.�.�~�>�?��L�L��0�0��^�1D�f�M�N��y�y���r�filenamec��t|dd��5}tj|t��}|j	|�}ddd�|S#1swYSxYw)zETransform the YAML specified by filename into an RST-formatted string�rzutf-8)�encoding)�LoaderN)�open�yaml�loadrr�)rr��	spec_file�
numbered_yaml�contents     r�parse_yaml_filezYnlDocGenerator.parse_yaml_file�sH��
�(�C�'�
2�i� �I�I�i�8J�K�M��o�o�m�4�G�3���	3���s�-A�ANr|)rrrrrr�rrr0rr�rr�r�r�r�r�r�r�r�r�r(rrr�r��sb��#�
�/�C� �T�$�s�C�x�.�-A� �c� � ��S�#�X�� �s� �3� �" ��c�3�h�� �� �C� �' �4��S�#�X��+?�' �C�' �TW�' �R �T�$�s�C�x�.�%9� �#� �#� �6 �d�3��8�n� �� �� �:& �t�D��c��N�';�& ��& �PS�& �P �$�t�C��H�~�*>� �3� �SV� �,/ �d�3��8�n�/ ��/ �h����rr�)r�typingrrrr�r�
SafeLoaderrrr�r(rr�<module>r�sC��

�#�"���������m'�m'�^A�Ar

Youez - 2016 - github.com/yon3zu
LinuXploit