
    +c                         d Z ddlmZmZmZ ddlmZmZ g dZ G d d      Z	 G d de      Z
 e
       Z G d	 d
e      Z G d de      Z G d d      Zy)zcMessages for talking to the DBus daemon itself

Generated by jeepney.bindgen and modified by hand.
   )MessageMessageTypeHeaderFields)MessageGeneratornew_method_call)DBusNameFlagsDBusmessage_bus
MonitoringStats	MatchRulec                       e Zd ZdZdZdZy)r   r         N)__name__
__module____qualname__allow_replacementreplace_existingdo_not_queue     6/usr/lib/python3/dist-packages/jeepney/bus_messages.pyr   r      s    Lr   r   c                        e Zd ZdZdZ	 	 d fd	Zd ZddZd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Z xZS )r	   z(Messages to talk to the message bus
    org.freedesktop.DBusc                 (    t         |   ||       y N)object_pathbus_namesuper__init__selfr   r   	__class__s      r   r"   zDBus.__init__       [8Dr   c                     t        | d      S )NHellor   r$   s    r   r(   z
DBus.Hello       tW--r   c                 "    t        | dd||f      S )NRequestNamesur)   )r$   nameflagss      r   r-   zDBus.RequestName"   s    t]D4-HHr   c                      t        | dd|f      S )NReleaseNamesr)   r$   r/   s     r   r2   zDBus.ReleaseName%   s    t]C$AAr   c                 "    t        | dd|df      S )NStartServiceByNamer.       r)   r4   s     r   r6   zDBus.StartServiceByName(   s    t%94 $ay* 	*r   c                      t        | dd|f      S )NUpdateActivationEnvironmentza{ss}r)   )r$   envs     r   r9   z DBus.UpdateActivationEnvironment,   s    t%BG #v' 	'r   c                      t        | dd|f      S )NNameHasOwnerr3   r)   r4   s     r   r<   zDBus.NameHasOwner0       t^S4'BBr   c                     t        | d      S )N	ListNamesr)   r*   s    r   r?   zDBus.ListNames3   s    t[11r   c                     t        | d      S )NListActivatableNamesr)   r*   s    r   rA   zDBus.ListActivatableNames6   s    t%;<<r   c                 `    t        |t              r|j                         }t        | dd|f      S )z4*rule* can be a str or a :class:`MatchRule` instanceAddMatchr3   
isinstancer   	serialiser   r$   rules     r   rC   zDBus.AddMatch9   s+    dI&>>#DtZtg>>r   c                 `    t        |t              r|j                         }t        | dd|f      S )NRemoveMatchr3   rD   rG   s     r   rJ   zDBus.RemoveMatch?   s+    dI&>>#Dt]C$AAr   c                      t        | dd|f      S )NGetNameOwnerr3   r)   r4   s     r   rL   zDBus.GetNameOwnerD   r=   r   c                      t        | dd|f      S )NListQueuedOwnersr3   r)   r4   s     r   rN   zDBus.ListQueuedOwnersG   s    t%7tgFFr   c                      t        | dd|f      S )NGetConnectionUnixUserr3   r)   r4   s     r   rP   zDBus.GetConnectionUnixUserJ   s    t%<cD7KKr   c                      t        | dd|f      S )NGetConnectionUnixProcessIDr3   r)   r4   s     r   rR   zDBus.GetConnectionUnixProcessIDM   s    t%A3PPr   c                      t        | dd|f      S )NGetAdtAuditSessionDatar3   r)   r4   s     r   rT   zDBus.GetAdtAuditSessionDataP   s    t%=sTGLLr   c                      t        | dd|f      S )N#GetConnectionSELinuxSecurityContextr3   r)   r4   s     r   rV   z(DBus.GetConnectionSELinuxSecurityContextS   s    t%JC $w( 	(r   c                     t        | d      S )NReloadConfigr)   r*   s    r   rX   zDBus.ReloadConfigW   s    t^44r   c                     t        | d      S )NGetIdr)   r*   s    r   rZ   z
DBus.GetIdZ   r+   r   c                      t        | dd|f      S )NGetConnectionCredentialsr3   r)   r4   s     r   r\   zDBus.GetConnectionCredentials]   s    t%?tgNNr   z/org/freedesktop/DBusr   )r7   )r   r   r   __doc__	interfacer"   r(   r-   r2   r6   r9   r<   r?   rA   rC   rJ   rL   rN   rP   rR   rT   rV   rX   rZ   r\   __classcell__r%   s   @r   r	   r	      s    &I#:0E.IB*'C2=?B
CGLQM(5.Or   r	   c                   .     e Zd ZdZ	 	 d fd	Zd Z xZS )r   zorg.freedesktop.DBus.Monitoringc                 (    t         |   ||       y r   r    r#   s      r   r"   zMonitoring.__init__e   r&   r   c                 "    t        | dd|df      S )z:Convert this connection to a monitor connection (advanced)BecomeMonitorasur7   r)   )r$   ruless     r   re   zMonitoring.BecomeMonitori   s    t_eeQZHHr   r]   )r   r   r   r_   r"   re   r`   ra   s   @r   r   r   b   s    1I#:0EIr   r   c                   :     e Zd ZdZ	 	 d fd	Zd Zd Zd Z xZS )r   z org.freedesktop.DBus.Debug.Statsc                 (    t         |   ||       y r   r    r#   s      r   r"   zStats.__init__p   r&   r   c                     t        | d      S )NGetStatsr)   r*   s    r   rk   zStats.GetStatst   s    tZ00r   c                      t        | dd|f      S )NGetConnectionStatsr3   r)   )r$   arg0s     r   rm   zStats.GetConnectionStatsw   s    t%93 $w( 	(r   c                     t        | d      S )NGetAllMatchRulesr)   r*   s    r   rp   zStats.GetAllMatchRules{   s    t%788r   r]   )	r   r   r   r_   r"   rk   rm   rp   r`   ra   s   @r   r   r   m   s#    2I#:0E1(9r   r   c            	       X    e Zd ZdZddddddddddZddedefdZd	efd
Zde	d	e
fdZy)r   a>  Construct a match rule to subscribe to DBus messages.
    
    e.g.::
    
        mr = MatchRule(
            interface='org.freedesktop.DBus',
            member='NameOwnerChanged',
            type='signal'
        )
        msg = message_bus.AddMatch(mr)
        # Send this message to subscribe to the signal
    NF)typesenderr_   memberpathpath_namespacedestination	eavesdropc                    t        |t              r	t        |   }|| _        |||||d}	|	j	                         D 
ci c]  \  }
}|	|
| c}}
| _        || _        || _        i | _        y c c}}
w )N)rs   r_   rt   ru   rw   )	rE   strr   message_typeitemsheader_fieldsrv   rx   arg_conditions)r$   rr   rs   r_   rt   ru   rv   rw   rx   fieldskvs               r   r"   zMatchRule.__init__   s     dC t$D "&
  &||~
a!-AqD
 -" 
s   
A+A+argnovaluec                     |dvrt        dj                  |            |dk(  r|dk7  rt        d      ||f| j                  |<   y)zAdd a condition for a particular argument
        
        argno: int, 0-63
        kind: 'string', 'path', 'namespace'
        >   ru   string	namespacez	kind={!r}r   r7   z$argno must be 0 for kind='namespace'N)
ValueErrorformatr~   )r$   r   r   kinds       r   add_arg_conditionzMatchRule.add_arg_condition   sQ     66[//566;5A:CDD&+T]E"r   returnc                    t        | j                  j                               }| j                  r'|j	                  d| j                  j
                  f       | j                  r|j	                  d       | j                  j                         D ]'  \  }\  }}|dk(  rd}|j	                  d| | |f       ) dj                  d |D              S )zAConvert to a string to use in an AddMatch call to the message busrr   )rx   truer    arg,c              3   f   K   | ])  \  }}d j                  ||j                  dd             + yw)z{}='{}''z'\''N)r   replace).0r   r   s      r   	<genexpr>z&MatchRule.serialise.<locals>.<genexpr>   s1      
=CaIQ		#w 78
s   /1)	listr}   r|   r{   appendr/   rx   r~   join)r$   pairsr   valr   s        r   rF   zMatchRule.serialise   s    T''--/0LL&$"3"3"8"89:>>LL./"&"5"5";";"= 	5E;CxLLCwtf-s34	5 xx 
GL
 
 	
r   msgc                    |j                   }| j                  |j                  | j                  k7  ry| j                  j                         D ]-  \  }}|j                  j                  t        |   d      |k7  s- y | j                  _|j                  j                  t        j                  d      }| j                  j                  d      }||k(  s|j                  |dz         sy| j                  j                         D ]  \  }\  }}|t        |j                        k\  r y|j                  |   }	t        |	t              s y|dk(  r|	|k7  sO y|dk(  rN|	|k(  r\|j!                  d      r|	j                  |      r|	j!                  d      r|j                  |	      r y|dk(  s|	|k(  r|	j                  |dz         r y y	)
z%Returns True if msg matches this ruleNF /r   ru   r   .T)headerr{   r}   r|   r   getr   rv   ru   rstrip
startswithr~   lenbodyrE   rz   endswith)
r$   r   hfieldexpectedru   path_nsr   r   r   s
             r   matcheszMatchRule.matches   s   JJ)q~~ARAR/R#11779 	OE8xx||L/6(B	 *88<< 1 148D))005GW_3)G'+':':'@'@'B 	!#E#HdCHH%((5/Cc3'x(? H_ ))#.3>>(3KS)h.A.A#.F $H_~~hn5 +	!. r   )r   )r   r   r   r^   r"   intrz   r   rF   r   boolr   r   r   r   r   r      sS      $DD4T !(
3s 
33 
3
3 
0'7 't 'r   r   N)r^   	low_levelr   r   r   wrappersr   r   __all__r   r	   r
   r   r   r   r   r   r   <module>r      si    : 9 7 
HO HOT f	I! 	I9 9$l lr   