BYPASS SHELL BY ./RAZORGANZ
Server: nginx/1.20.1
System: Linux iZdzfnv9mwfppeZ 5.10.134-19.2.al8.x86_64 #1 SMP Wed Oct 29 22:47:09 CST 2025 x86_64
User: apache (48)
PHP: 8.2.30
Disabled: NONE
Upload Files
File: //usr/share/glib-2.0/codegen/__pycache__/codegen_docbook.cpython-36.opt-1.pyc
3

]xa�H�@s2ddlZddlmZddlmZGdd�d�ZdS)�N)�path�)�utilsc@s|eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS)�DocbookCodeGeneratorcCs||_|j�dS)N)�ifaces�generate_expand_dicts)�selfr�r	�/./usr/share/glib-2.0/codegen/codegen_docbook.py�__init__$szDocbookCodeGenerator.__init__c	Csd}|r*x0|jD]}tt|j�|�}qWntt|j�|�}d}|r�x�|jD]D}x|jD]}tt|j�|�}qVWx|jD]}tt|j�|�}qvWqJWn@x|jD]}tt|j�|�}q�Wx|jD]}tt|j�|�}q�W|�r|jjdt	j
|j�|j|j|t|j�df�n"|jjd|j|t|j�df�d}x`|jD]V}|dk�r`|jjd|ddf�|jjd|j|t|j�d|jf�|d}�q:Wx`|jD]V}|dk�r�|jjd|ddf�|jjd	|j|t|j�d|jf�|d}�q�W|jjd
�dS)Nrz1<link linkend="gdbus-method-%s.%s">%s</link>%*s (�z%s%*s (z,
%*s�zIN  %s%*s %srzOUT %s%*s %sz);
)�methods�max�len�name�in_args�	signature�out_args�out�writer�dots_to_hyphens)	r�i�m�in_synopsisZmax_method_lenZ_m�max_signature_len�a�countr	r	r
�print_method_prototype(sR
"

z+DocbookCodeGenerator.print_method_prototypec	Cs`d}|r*x0|jD]}tt|j�|�}qWntt|j�|�}d}|rtxP|jD]$}x|jD]}tt|j�|�}qVWqJWn x|jD]}tt|j�|�}q|W|r�|jjdtj	|j�|j|j|t|j�df�n"|jjd|j|t|j�df�d}x^|jD]T}|dk�r|jjd|ddf�|jjd|j|t|j�d|jf�|d}q�W|jjd	�dS)
Nrz1<link linkend="gdbus-signal-%s.%s">%s</link>%*s (rz%s%*s (z,
%*sr
z%s%*s %srz);
)
�signalsrrr�argsrrrrr)	rr�srZmax_signal_lenZ_srrrr	r	r
�print_signal_prototype]s<
"
z+DocbookCodeGenerator.print_signal_prototypecCsd}|r*x0|jD]}tt|j�|�}qWntt|j�|�}d}|rdx0|jD]}tt|j�|�}qJWntt|j�|�}|r�|jjdtj|j�|j|j|t|j�df�n"|jjd|j|t|j�df�|j	r�|j
r�d}n|j	r�d}nd}|jjd||jf�dS)	Nrz1<link linkend="gdbus-property-%s.%s">%s</link>%*srz%s%*sZ	readwritez	readable z	writable z	  %s  %s
)�
propertiesrrrrrrrr�readable�writable)rr�prZmax_property_lenZ_pr�accessr	r	r
�print_property_prototype�s2
"z-DocbookCodeGenerator.print_property_prototypecCs`|jjd�|jjd�|jjd�x|jD]}|j||dd�q,W|jjd�|jjd�dS)Nz#  <refsynopsisdiv role="synopsis">
z1    <title role="synopsis.title">Methods</title>
z    <synopsis>
T)rz</synopsis>
z  </refsynopsisdiv>
)rrrr)rrrr	r	r
�print_synopsis_methods�sz+DocbookCodeGenerator.print_synopsis_methodscCs`|jjd�|jjd�|jjd�x|jD]}|j||dd�q,W|jjd�|jjd�dS)Nz!  <refsect1 role="signal_proto">
z5    <title role="signal_proto.title">Signals</title>
z    <synopsis>
T)rz</synopsis>
z  </refsect1>
)rrrr")rrr!r	r	r
�print_synopsis_signals�sz+DocbookCodeGenerator.print_synopsis_signalscCs`|jjd�|jjd�|jjd�x|jD]}|j||dd�q,W|jjd�|jjd�dS)Nz  <refsect1 role="properties">
z6    <title role="properties.title">Properties</title>
z    <synopsis>
T)rz</synopsis>
z  </refsect1>
)rrr#r()rrr&r	r	r
�print_synopsis_properties�sz.DocbookCodeGenerator.print_synopsis_propertiescCs�|jjdtj|j�|jf�|jjd|j�|jjdtj|j�|j|j|j|j|jf�|jjd�|j||dd�|jjd�|jjd|j|jd	��|j	s�|j
�r||jjd
�xX|j	D]N}|jjd�|jjd|j|jf�|jjd
|j|jd	��|jjd�q�WxZ|j
D]P}|jjd�|jjd|j|jf�|jjd
|j|jd	��|jjd��qW|jjd�t|j
�dk�r�|jjd|j
�|j�r�|jjd|j�|jjd�dS)Nz1<refsect2 role="method" id="gdbus-method-%s.%s">
z!  <title>The %s() method</title>
z]  <indexterm zone="gdbus-method-%s.%s"><primary sortas="%s.%s">%s.%s()</primary></indexterm>
z<programlisting>
F)rz</programlisting>
z%s
Tz<variablelist role="params">
z<varlistentry>
zC  <term><literal>IN %s <parameter>%s</parameter></literal>:</term>
z  <listitem>%s</listitem>
z</varlistentry>
zD  <term><literal>OUT %s <parameter>%s</parameter></literal>:</term>
z</variablelist>
rz#<para role="since">Since %s</para>
z><warning><para>The %s() method is deprecated.</para></warning>z</refsect2>
)rrrrr�name_without_prefixr�expand_paras�
doc_stringrrrr�since�
deprecated)rrrrr	r	r
�print_method�sX

z!DocbookCodeGenerator.print_methodcCsf|jjdtj|j�|jf�|jjd|j�|jjdtj|j�|j|j|j|j|jf�|jjd�|j||dd�|jjd�|jjd|j|jd	��|j	�r|jjd
�xX|j	D]N}|jjd�|jjd|j
|jf�|jjd
|j|jd	��|jjd�q�W|jjd�t|j�dk�r<|jjd|j�|j
�rV|jjd|j�|jjd�dS)Nz1<refsect2 role="signal" id="gdbus-signal-%s.%s">
z!  <title>The "%s" signal</title>
z]  <indexterm zone="gdbus-signal-%s.%s"><primary sortas="%s::%s">%s::%s</primary></indexterm>
z<programlisting>
F)rz</programlisting>
z%s
Tz<variablelist role="params">
z<varlistentry>
z@  <term><literal>%s <parameter>%s</parameter></literal>:</term>
z  <listitem>%s</listitem>
z</varlistentry>
z</variablelist>
rz#<para role="since">Since %s</para>
z><warning><para>The "%s" signal is deprecated.</para></warning>z</refsect2>
)rrrrrr,r"r-r.r rrr/r0)rrr!rr	r	r
�print_signal�sF

z!DocbookCodeGenerator.print_signalcCs�|jjdtj|j�|jf�|jjd|j�|jjdtj|j�|j|j|j|j|jf�|jjd�|j||dd�|jjd�|jjd|j|jd	��t	|j
�d
kr�|jjd|j
�|jr�|jjd|j�|jjd
�dS)Nz5<refsect2 role="property" id="gdbus-property-%s.%s">
z#  <title>The "%s" property</title>
z]  <indexterm zone="gdbus-property-%s.%s"><primary sortas="%s:%s">%s:%s</primary></indexterm>
z<programlisting>
F)rz</programlisting>
z%s
Trz#<para role="since">Since %s</para>
z@<warning><para>The "%s" property is deprecated.</para></warning>z</refsect2>
)rrrrrr,r(r-r.rr/r0)rrr&r	r	r
�print_property(s.

z#DocbookCodeGenerator.print_propertycCspx |jD]}|j||j|�}qWx |jD]}|j||j|�}q*W|rltjddd�|�}tjddd�|�}|S)Nz@[a-zA-Z0-9_]*cSsd|jd�dd�dS)Nz<parameter>rrz</parameter>)�group)rr	r	r
�<lambda>Osz-DocbookCodeGenerator.expand.<locals>.<lambda>z%[a-zA-Z0-9_]*cSsd|jd�dd�dS)Nz
<constant>rrz</constant>)r4)rr	r	r
r5Us)�expand_member_dict_keys�replace�expand_member_dict�expand_iface_dict_keys�expand_iface_dict�re�sub)rr!�expandParamsAndConstants�keyr	r	r
�expandFszDocbookCodeGenerator.expandcCs&|j||�j�}|jd�s"d|}|S)Nz<paraz<para>%s</para>)r?�strip�
startswith)rr!r=r	r	r
r-Zs
z!DocbookCodeGenerator.expand_parascCs@i|_i|_�x|jD]�}d|j}dtj|j�|jf}||j|<xB|jD]8}d|j|jf}dtj|j�|j|jf}||j|<qLWxB|jD]8}d|j|jf}dtj|j�|j|jf}||j|<q�WxB|jD]8}d|j|jf}dtj|j�|j|jf}||j|<q�WqWt	|jj
�d	d
�|_t	|jj
�d	d
�|_dS)Nz#%sz8<link linkend="gdbus-interface-%s.top_of_page">%s</link>z%s.%s()z.<link linkend="gdbus-method-%s.%s">%s()</link>z#%s::%sz.<link linkend="gdbus-signal-%s.%s">"%s"</link>z#%s:%sz0<link linkend="gdbus-property-%s.%s">"%s"</link>T)�reverse)
r8r:rrrrrrr#�sorted�keysr6r9)rrr>�valuerr!r&r	r	r
r`sB









z*DocbookCodeGenerator.generate_expand_dictscCs�x|jD�]�}ttj|d||jf�d�|_|jjd�|jjd�|jjd�|jjd�|jjd�|jjd|j�|jjd	�|jjd
tj|j�|jf�|jjdtj|j�|j	|jf�|jjd�|jjd
�|jjd|j�|jjd|j
�|jjd�t|j�dk�r*|j
|�t|j�dk�rD|j|�t|j�dk�r^|j|�|jjdtj|j��|jjd�|jjd|j|jd��t|j�dk�r�|jjd|j�|j�r�|jjd|j�|jjd�t|j�dk�r<|jjd|j�|jjd�x|jD]}|j||��qW|jjd�t|j�dk�r�|jjd|j�|jjd�x|jD]}|j||��qrW|jjd�t|j�dk�r�|jjd|j�|jjd�x|jD]}|j||��q�W|jjd�|jjd�|jjd �q
WdS)!Nz	%s-%s.xml�wrz'<?xml version="1.0" encoding="utf-8"?>
zA<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
zL               "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
z]>
z<refentry id="gdbus-%s">
z  <refmeta>z]    <refentrytitle role="top_of_page" id="gdbus-interface-%s.top_of_page">%s</refentrytitle>
za  <indexterm zone="gdbus-interface-%s.top_of_page"><primary sortas="%s">%s</primary></indexterm>
z  </refmeta>z  <refnamediv>z    <refname>%s</refname>z    <refpurpose>%s</refpurpose>z  </refnamediv>rz/<refsect1 role="desc" id="gdbus-interface-%s">
z/  <title role="desc.title">Description</title>
z  %s
Tz%  <para role="since">Since %s</para>
z?<warning><para>The %s interface is deprecated.</para></warning>z</refsect1>
z0<refsect1 role="details" id="gdbus-methods-%s">
z5  <title role="details.title">Method Details</title>
z0<refsect1 role="details" id="gdbus-signals-%s">
z5  <title role="details.title">Signal Details</title>
z3<refsect1 role="details" id="gdbus-properties-%s">
z7  <title role="details.title">Property Details</title>
z</refentry>
�
)r�openr�joinrrrrrr,Zdoc_string_briefrrr)rr*r#r+r-r.r/r0r1r2r3)rZdocbookZoutdirrrr!r	r	r
�generate�s�



zDocbookCodeGenerator.generateN)�__name__�
__module__�__qualname__rrr"r(r)r*r+r1r2r3r?r-rrJr	r	r	r
r#s5)$			7,+r)r;�osrrrrr	r	r	r
�<module>s