Sindbad~EG File Manager
3
ָVXk � @ s� d dl mZ d dlmZ ddlT ddlmZ ddlm Z ddl
mZmZ ddl
mZ G d d
� d
e�ZG dd� de�Zd
d� Zdd� ZdS )� )�GLib)�ElementTree� )�*)�ProxyMethod)�
ProxyProperty)�ProxySignal�OnSignal)�timeout_to_glibc @ s e Zd Zf Zddd�ZdS )�
ProxyMixinNc
K s� x(|D ] }|d
krt | jdj|� ��qW |jdd�}t|�}t||�}| jj||dddtj j
d�dt|�d� }|s|td��|j
� \}ytj|�}W n td ��Y nX t|�| ||�S )a5 Get a remote object.
Parameters
----------
bus_name : string
Name of the service that exposes this object.
You may start with "." - then org.freedesktop will be automatically prepended.
object_path : string, optional
Path of the object. If not provided, bus_name translated to path format is used.
Returns
-------
ProxyObject implementing all the Interfaces exposed by the remote object.
Note that it inherits from multiple Interfaces, so the method you want to use
may be shadowed by another one, eg. from a newer version of the interface.
Therefore, to interact with only a single interface, use:
>>> bus.get("org.freedesktop.systemd1")["org.freedesktop.systemd1.Manager"]
or simply
>>> bus.get(".systemd1")[".Manager"]
which will give you access to the one specific interface.
�timeoutz( got an unexpected keyword argument '{}'Nz#org.freedesktop.DBus.IntrospectableZ
Introspectz(s)r zPno such object; you might need to pass object path as the 2nd argument for get()z)object provides invalid introspection XML)r )� TypeError�__qualname__�format�getZ
auto_bus_nameZauto_object_pathZconZ call_syncr ZVariantType�newr
�KeyError�unpack�ETZ
fromstring�CompositeInterface) �self�bus_nameZobject_path�kwargsZkwargr �retZxml�
introspection� r �/usr/lib/python3.6/proxy.pyr
s$
zProxyMixin.get)N)�__name__�
__module__r � __slots__r r r r r r
s r c @ s e Zd Zddd�ZdS )�ProxyObjectNc C s$ || _ || _|| _|r|n| | _d S )N)�_bus� _bus_name�_pathZ_object)r Zbusr �path�objectr r r �__init__>