eaiovnaovbqoebvqoeavibavo 3 ָVXk@sddlmZddlmZddlTddlmZddlm Z ddl m Z m Z ddl mZGd d d eZGd d d eZd dZddZdS))GLib) ElementTree)*) ProxyMethod) ProxyProperty) ProxySignalOnSignal)timeout_to_glibc@seZdZfZdddZdS) ProxyMixinNc Ksx(|D] }|d krt|jdj|qW|jdd}t|}t||}|jj||dddtj j ddt |d }|s|t d|j \}ytj|}Wnt d YnXt||||S) a5Get 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)rzPno such object; you might need to pass object path as the 2nd argument for get()z)object provides invalid introspection XML)r ) TypeError __qualname__formatgetZ auto_bus_nameZauto_object_pathZconZ call_syncrZ VariantTypenewr KeyErrorunpackETZ fromstringCompositeInterface) selfbus_nameZ object_pathkwargsZkwargr retZxml introspectionr/usr/lib/python3.6/proxy.pyr s$    zProxyMixin.get)N)__name__ __module__r __slots__rrrrrr sr c@seZdZdddZdS) ProxyObjectNcCs$||_||_||_|r|n||_dS)N)_bus _bus_name_pathZ_object)rZbusrpathobjectrrr__init__>szProxyObject.__init__)N)rrrr&rrrrr =sr csGfdddt}jd|_|_d|_xD]}|jd}|jdkr`t||t|j|q2|jdkrt||t|j|q2|jdkr2t |j|}t|||t|d|t |q2W|S) NcseZdZefddZdS)zInterface..interfacecsFtjddx(D] }td|jd|jdqWtdS)Nname:  )printattribtag)member)ifacerr _IntrospectGs  z(Interface..interface._IntrospectN)rrr staticmethodr0r)r/rr interfaceFsr2r'DBUSmethodpropertysignalZon) r r,rrrr-setattrrrrr )r/r2r. member_namer6r)r/r InterfaceDs       r9cCszGdddt}tdd|Dddd}|s6tdtd d |D|_d |_d d jdd |jDd|_d|_|S)Nc@s eZdZddZeddZdS)z+CompositeInterface..CompositeObjectcsdksddkr.|jjddddfddt|jD}t|dkrZtt|dksjt|d}||j|j|j|S)Nr./rcsg|]}|jkr|qSr)r).0base)r/rr cszKCompositeInterface..CompositeObject.__getitem__..) r#replacetype __bases__lenrAssertionErrorr!r")rr/Zmatching_basesZ iface_classr)r/r __getitem__`s z7CompositeInterface..CompositeObject.__getitem__c Ss.x(|jD]}y |jWqYqXqWdS)N)rBr0)clsr/rrrr0ls   z7CompositeInterface..CompositeObject._IntrospectN)rrrrE classmethodr0rrrrCompositeObject_s rHcSsg|]}|jdkr|qS)r2)r-)r=xrrrr?tsz&CompositeInterface..cSst|jdjdS)Nr'zorg.freedesktop.DBus.)intr, startswith)rIrrrtsz$CompositeInterface..)keyzgobject does not export any interfaces; you might need to pass object path as the 2nd argument for get()css|]}t|VqdS)N)r9)r=r/rrr wsz%CompositeInterface..zz(+css|] }|jVqdS)N)r)r=rIrrrrNys)r3) r sortedrtuplerBrjoinrr)rrHZifacesrrrr^s rN)Z gi.repositoryrZ xml.etreerrZ auto_namesZ proxy_methodrZproxy_propertyrZ proxy_signalrr r r r%r r r9rrrrrs     3