+
    ic#  c                   sh    ^ RI Ht ^ RIHt . R
Ot ! R R]4      t ! R R]4      t ! R R]4      t	R	# )i    )
namedtuple)	XMLParserDBusSpecificationErrorDBusSpecificationDBusSpecificationParserc                   s    ] tR t^#tRtRtR# )r   z,Exception for the DBus specification errors. N)__name__
__module____qualname____firstlineno____doc____static_attributes__r       9/usr/lib/python3.14/site-packages/dasbus/specification.pyr   r   #   s    6r   c                   s   a  ] tR t^(t o RtRtRtRtRtRt	Rt
Rt]! R	. RO4      t]! R
. RO4      t]! R. RO4      tR.t]R 4       tR t]R 4       t]R 4       tR tR tRtV tR# )r   zDBus XML specification.ZinZoutZreadZwriteZ	readwriteZreturna  
    <node>
        <interface name="org.freedesktop.DBus.Introspectable">
            <method name="Introspect">
            <arg type="s" name="xml_data" direction="out"/>
            </method>
        </interface>
        <interface name="org.freedesktop.DBus.Peer">
            <method name="Ping"/>
            <method name="GetMachineId">
                <arg type="s" name="machine_uuid" direction="out"/>
            </method>
       </interface>
        <interface name="org.freedesktop.DBus.Properties">
            <method name="Get">
                <arg type="s" name="interface_name" direction="in"/>
                <arg type="s" name="property_name" direction="in"/>
                <arg type="v" name="value" direction="out"/>
            </method>
            <method name="GetAll">
                <arg type="s" name="interface_name" direction="in"/>
                <arg type="a{sv}" name="properties" direction="out"/>
            </method>
            <method name="Set">
                <arg type="s" name="interface_name" direction="in"/>
                <arg type="s" name="property_name" direction="in"/>
                <arg type="v" name="value" direction="in"/>
            </method>
            <signal name="PropertiesChanged">
                <arg type="s" name="interface_name"/>
                <arg type="a{sv}" name="changed_properties"/>
                <arg type="as" name="invalidated_properties"/>
            </signal>
        </interface>
    </node>
    SignalMethodProperty_membersc                s,    \         P                  W4      # )z.Return a DBus specification for the given XML.)r   parse_specification)clsxml   &&r   from_xmlZDBusSpecification.from_xmlp   s     '::3DDr   c                s    / V n         R# )z Create a new DBus specification.Nr   self   &r   __init__ZDBusSpecification.__init__u   s	    r   c                sv    \        \        V P                  P                  4       4      P                  4       4      # )z%Interfaces of the DBus specification.)listZdictr   Zkeysr   r   r   
interfacesZDBusSpecification.interfacesy   s*     D++-.33566r   c                sH    \        V P                  P                  4       4      # )z"Members of the DBus specification.)r   r   Zvaluesr   r   r   membersZDBusSpecification.members~   s     DMM((*++r   c                sN    WP                   VP                  VP                  3&   R# )z!Add a member of a DBus interface.N)r   interface_namename)r   memberr   r   
add_memberZDBusSpecification.add_member   s    >Dv,,fkk:;r   c                s     V P                   W3,          #   \         d     Mi ; i\        RP                  Y4      4      h)z!Get a member of a DBus interface.z)DBus specification has no member '{}.{}'.)r   ZKeyErrorr   format)r   r   Zmember_names   &&&r   
get_memberZDBusSpecification.get_member   sK    	==.!>?? 		 %7>>
 	
s    $$r   Nr    r   typer    r   Zin_typeZout_typer    r   readablewritabler&   )r   r   r   r	   r
   DIRECTION_INDIRECTION_OUTACCESS_READACCESS_WRITEACCESS_READWRITEZRETURN_PARAMETERSTANDARD_INTERFACESr    r   r   r   Z	__slots__classmethodr   r   Zpropertyr   r   r"   r$   r   __classdictcell__Z__classdict__   @r   r   r   (   s     !LMKL"#L  # F  # F * ' H IE E 7 7 , ,E
 
r   c                   s   a  ] tR t^t o Rt]t]]3R l4       t	]R 4       t
]R 4       t]R 4       t]R 4       t]R 4       t]R 4       tR	tV tR
# )r   z)Class for parsing DBus XML specification.c                sv    V! 4       pV P                  V\        P                  4       V P                  W14       V# )zGenerate a representation of a DBus XML specification.

:param xml: the XML specification to parse
:param factory: the DBus specification factory
:return: a representation od the DBus specification
)
_parse_xmlr   r0   )r   r   Zfactoryspecifications   &&& r   r   Z+DBusSpecificationParser.parse_specification   s2      	}&7&K&KL}*r   c                s    V P                   P                  V4      pV F7  pV P                   P                  V4      '       g   K&  V P                  W4       K9  	  R# )zParse the given XML.N)
xml_parserZxml_to_elementZis_interface_parse_interface)r   r6   r   Znodeinterface_elements   &&&  r   r5   Z"DBusSpecificationParser._parse_xml   sN     ~~,,S1 "&>>../@AA   B "&r   c                s   V P                   P                  V4      pV F  pV P                   P                  V4      '       d   V P                  W44      pMhV P                   P	                  V4      '       d   V P                  W44      pM5V P                   P                  V4      '       d   V P                  W44      pMK  VP                  V4       K  	  V# )z8Parse the interface element from the DBus specification.)	r7   get_nameZis_property_parse_propertyZ	is_signal_parse_signalZ	is_method_parse_methodr"   )r   r6   r9   r   Zmember_elementr!   s   &&&   r   r8   Z(DBusSpecificationParser._parse_interface   s     001BC 0N~~)).99,,^L)).99**>J)).99**>J  $$V, 0" r   c                sd   V P                   P                  V4      pV P                   P                  V4      pV P                   P                  V4      pV\        P
                  \        P                  39   pV\        P                  \        P                  39   p\        P                  VVVVVR7      # )z7Parse the property element from the DBus specification.r(   )	r7   r:   get_typeZ
get_accessr   r-   r/   r.   r   )r   r   Zproperty_elementZproperty_nameZproperty_typeZproperty_accessr)   r*   s   &&&     r   r;   Z'DBusSpecificationParser._parse_property   s     //0@A//0@A..334DE"))..'
 

 #**..'
 

 !))) * 
 	
r   c                s:   V P                   P                  V4      p. pV FR  pV P                   P                  V4      '       g   K&  V P                   P                  V4      pVP	                  V4       KT  	  \
        P                  VVV P                  V4      R7      # )z5Parse the signal element from the DBus specification.r%   )r7   r:   is_parameterr>   appendr   r   	_get_type)r   r   Zsignal_elementZsignal_nameZsignal_typeelementelement_types   &&&    r   r<   Z%DBusSpecificationParser._parse_signal   s     nn--n=%G>>..w77>>227;L|, & !''){+ ( 
 	
r   c                s   V P                   P                  V4      p. p. pV F  pV P                   P                  V4      '       g   K&  V P                   P                  V4      pV P                   P	                  V4      pV\
        P                  8X  d   VP                  V4       K  V\
        P                  8X  g   K  VP                  V4       K  	  \
        P                  VVV P                  V4      V P                  V4      R7      # )z5Parse the method element from the DBus specification.r'   )r7   r:   r?   Zget_directionr>   r   r+   r@   r,   r   rA   )	r   r   Zmethod_elementZmethod_nameZin_typesZ	out_typesrB   Z	directionrC   s	   &&&      r   r=   Z%DBusSpecificationParser._parse_method   s     nn--n=	%G>>..w7744W=I>>227;L-:::-/===  . & !'')MM(+]]9-	 ( 
 	
r   c                sV    V'       g   R# RP                  RP                  V4      4      # )zJoin types into one value.Nz({})Z )r#   Zjoin)r   Ztypesr   r   rA   Z!DBusSpecificationParser._get_type  s!     }}RWWU^,,r   r   N)r   r   r   r	   r
   r   r7   r1   r   r   r5   r8   r;   r<   r=   rA   r   r2   r3   r4   r   r   r      s     3 J.? 
 
 
C 
C  0 
 
0 
 
$ 
 
4 - -r   N)r   r   r   )
Zcollectionsr    Z
dasbus.xmlr   Z__all__Z	Exceptionr   Zobjectr   r   r   r   r   <module>rD      s=   0 #  	Y 	
j
 j
ZF-f F-r   