B
    R[p                 @   sj   d Z ddlmZmZ G dd dZG dd deZe ZG dd deZG d	d
 d
eZG dd dZ	dS )zcMessages for talking to the DBus daemon itself

Generated by jeepney.bindgen and modified by hand.
   )MessageGeneratornew_method_callc               @   s   e Zd ZdZdZdZdS )DBusNameFlagsr         N)__name__
__module____qualname__Zallow_replacementZreplace_existingZdo_not_queue r
   r
   3lib/python3.7/site-packages/jeepney/bus_messages.pyr      s   r   c                   s   e Zd ZdZd, fdd	Zdd Zd-dd	Zd
d Zdd Zdd Z	dd Z
dd Zdd Zdd Zdd Zdd Zdd Zdd Zd d! Zd"d# Zd$d% Zd&d' Zd(d) Zd*d+ Z  ZS ).DBusorg.freedesktop.DBus/org/freedesktop/DBusc                s   t  j||d d S )N)object_pathbus_name)super__init__)selfr   r   )	__class__r
   r   r      s    zDBus.__init__c             C   s
   t | dS )NHello)r   )r   r
   r
   r   r      s    z
DBus.Hello    c             C   s   t | dd||fS )NRequestNamesu)r   )r   nameflagsr
   r
   r   r      s    zDBus.RequestNamec             C   s   t | dd|fS )NReleaseNames)r   )r   r   r
   r
   r   r      s    zDBus.ReleaseNamec             C   s   t | dd|dfS )NStartServiceByNamer   r   )r   )r   r   r
   r
   r   r      s    zDBus.StartServiceByNamec             C   s   t | dd|fS )NUpdateActivationEnvironmentza{ss})r   )r   envr
   r
   r   r   !   s    z DBus.UpdateActivationEnvironmentc             C   s   t | dd|fS )NNameHasOwnerr   )r   )r   r   r
   r
   r   r    %   s    zDBus.NameHasOwnerc             C   s
   t | dS )N	ListNames)r   )r   r
   r
   r   r!   (   s    zDBus.ListNamesc             C   s
   t | dS )NListActivatableNames)r   )r   r
   r
   r   r"   +   s    zDBus.ListActivatableNamesc             C   s"   t |tr| }t| dd|fS )NAddMatchr   )
isinstance	MatchRule	serialiser   )r   ruler
   r
   r   r#   .   s    
zDBus.AddMatchc             C   s"   t |tr| }t| dd|fS )NRemoveMatchr   )r$   r%   r&   r   )r   r'   r
   r
   r   r(   3   s    
zDBus.RemoveMatchc             C   s   t | dd|fS )NGetNameOwnerr   )r   )r   r   r
   r
   r   r)   8   s    zDBus.GetNameOwnerc             C   s   t | dd|fS )NListQueuedOwnersr   )r   )r   r   r
   r
   r   r*   ;   s    zDBus.ListQueuedOwnersc             C   s   t | dd|fS )NGetConnectionUnixUserr   )r   )r   r   r
   r
   r   r+   >   s    zDBus.GetConnectionUnixUserc             C   s   t | dd|fS )NGetConnectionUnixProcessIDr   )r   )r   r   r
   r
   r   r,   A   s    zDBus.GetConnectionUnixProcessIDc             C   s   t | dd|fS )NGetAdtAuditSessionDatar   )r   )r   r   r
   r
   r   r-   D   s    zDBus.GetAdtAuditSessionDatac             C   s   t | dd|fS )N#GetConnectionSELinuxSecurityContextr   )r   )r   r   r
   r
   r   r.   G   s    z(DBus.GetConnectionSELinuxSecurityContextc             C   s
   t | dS )NReloadConfig)r   )r   r
   r
   r   r/   K   s    zDBus.ReloadConfigc             C   s
   t | dS )NGetId)r   )r   r
   r
   r   r0   N   s    z
DBus.GetIdc             C   s   t | dd|fS )NGetConnectionCredentialsr   )r   )r   r   r
   r
   r   r1   Q   s    zDBus.GetConnectionCredentials)r   r   )r   )r   r   r	   	interfacer   r   r   r   r   r   r    r!   r"   r#   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   __classcell__r
   r
   )r   r   r      s,    
r   c                   s*   e Zd ZdZd fdd	Zdd Z  ZS )	
Monitoringzorg.freedesktop.DBus.Monitoring/org/freedesktop/DBusorg.freedesktop.DBusc                s   t  j||d d S )N)r   r   )r   r   )r   r   r   )r   r
   r   r   Y   s    zMonitoring.__init__c             C   s   t | dd|dfS )NBecomeMonitorZasur   )r   )r   Zrulesr
   r
   r   r7   ]   s    zMonitoring.BecomeMonitor)r5   r6   )r   r   r	   r2   r   r7   r3   r
   r
   )r   r   r4   V   s    r4   c                   s:   e Zd ZdZd fdd	Zdd Zdd	 Zd
d Z  ZS )Statsz org.freedesktop.DBus.Debug.Stats/org/freedesktop/DBusorg.freedesktop.DBusc                s   t  j||d d S )N)r   r   )r   r   )r   r   r   )r   r
   r   r   c   s    zStats.__init__c             C   s
   t | dS )NGetStats)r   )r   r
   r
   r   r;   g   s    zStats.GetStatsc             C   s   t | dd|fS )NGetConnectionStatsr   )r   )r   Zarg0r
   r
   r   r<   j   s    zStats.GetConnectionStatsc             C   s
   t | dS )NGetAllMatchRules)r   )r   r
   r
   r   r=   n   s    zStats.GetAllMatchRules)r9   r:   )	r   r   r	   r2   r   r;   r<   r=   r3   r
   r
   )r   r   r8   `   s    r8   c            	   @   s>   e Zd ZdZdddddddddddZddd	Zd
d ZdS )r%   a  Construct a match rule to subscribe to DBus messages.
    
    e.g.::
    
        mr = MatchRule(interface='org.freedesktop.DBus', member='NameOwnerChanged',
                       type='signal')
        msg = add_match(mr)
        # Send this message to subscribe to the signal
    NF)typesenderr2   memberpathpath_namespacedestination	eavesdropc      
      C   sn   i  | _ }	|r||	d< |r"||	d< |r.||	d< |r:||	d< |rF||	d< |rR||	d< |r^||	d< |rjd|	d	< d S )
Nr>   r?   r2   r@   rA   rB   rC   truerD   )
conditions)
r   r>   r?   r2   r@   rA   rB   rC   rD   cr
   r
   r   r   |   s"    
zMatchRule.__init__stringc             C   sT   |dkrt d||dkr.|dkr.t d|dkr:d}d||}|| j|< d	S )
zAdd a condition for a particular argument
        
        argno: int, 0-63
        kind: 'string', 'path', 'namespace'
        >   rH   	namespacerA   z	kind={!r}rI   r   z$argno must be 0 for kind='namespace'rH    zarg{}{}N)
ValueErrorformatrF   )r   ZargnovalueZkindr   r
   r
   r   add_arg_condition   s    zMatchRule.add_arg_conditionc          
   C   sD   g }x4t | j D ]"\}}|d||dd qW d|S )Nz{}={}'z\',)sortedrF   itemsappendrL   replacejoin)r   partskvr
   r
   r   r&      s    zMatchRule.serialise)rH   )r   r   r	   __doc__r   rN   r&   r
   r
   r
   r   r%   r   s   	
r%   N)
rY   Zwrappersr   r   r   r   Zmessage_busr4   r8   r%   r
   r
   r
   r   <module>   s   G
