ó 毖Sc@s%ddlZyddlmZWn!ek rCddlmZnXddlZddlmZddlm Z m Z m Z m Z dZ ejdƒZddlmZmZmZmZmZddlmZd fd „ƒYZd fd „ƒYZd efd„ƒYZdefd„ƒYZdS(iÿÿÿÿN(tRLock(tprocess_introspection_data(t DBusExceptiontIntrospectionParserExceptiontMissingErrorHandlerExceptiontMissingReplyHandlerExceptiontrestructuredtexts dbus.proxies(tBUS_DAEMON_IFACEtBUS_DAEMON_NAMEtBUS_DAEMON_PATHtINTROSPECTABLE_IFACEt LOCAL_PATH(tis_py2t_DeferredMethodcBs)eZdZd„Zd„Zd„ZRS(sXA proxy method which will only get called once we have its introspection reply. cCs+||_|j|_||_||_dS(N(t _proxy_methodt _method_namet_appendt_block(tselft proxy_methodtappendtblock((s2/usr/lib64/python2.7/site-packages/dbus/proxies.pyt__init__6s   cOsVd|ks|jdtƒr8|j|j||ƒdS|jƒ|j||ŽSdS(Nt reply_handlert ignore_reply(tgettFalseRRtNoneR(Rtargstkeywords((s2/usr/lib64/python2.7/site-packages/dbus/proxies.pyt__call__=s   cOs|j|j||ƒdS(N(RR(RRR((s2/usr/lib64/python2.7/site-packages/dbus/proxies.pyt call_asyncHs(t__name__t __module__t__doc__RRR(((s2/usr/lib64/python2.7/site-packages/dbus/proxies.pyR 2s  t _ProxyMethodcBs)eZdZd„Zd„Zd„ZRS(s°A proxy method. Typically a member of a ProxyObject. Calls to the method produce messages that travel over the Bus and are routed to a specific named Service. cCs‚|tkrtdtƒ‚n||_||_||_||_tj|ƒ||_|dk rutj |ƒn||_ dS(Ns1Methods may not be called on the reserved path %s( R Rt_proxyt _connectiont_named_servicet _object_patht_dbus_bindingstvalidate_member_nameRRtvalidate_interface_namet_dbus_interface(Rtproxyt connectiontbus_namet object_patht method_nametiface((s2/usr/lib64/python2.7/site-packages/dbus/proxies.pyRSs         c Os‚|jddƒ}|jddƒ}|jdtƒ}|jddƒ}|dk s`|dk r¨|dkrxtƒ‚q¨|dkrtƒ‚q¨|r¨tdƒ‚q¨n|jd|jƒ}|dkr |dkrá|j}n|d|j}|jj j |dƒ}n|s|dk rS|j j |j |j||j|||||n+|j j|j |j||j|||SdS(NRt error_handlerRt signatures6ignore_reply and reply_handler cannot be used togethertdbus_interfacet.(tpopRRRRt TypeErrorR+RR$t_introspect_method_mapRR%RR&R't call_blocking( RRRRR2RR3R4tkey((s2/usr/lib64/python2.7/site-packages/dbus/proxies.pyRgsD        c OsÊ|jddƒ}|jddƒ}|jddƒ}|jd|jƒ}|dkr•|rq|d|j}n |j}|jjj|dƒ}n|jj|j |j ||j|||||dS(NRR2R3R4R5( R6RR+RR$R8RR%RR&R'(RRRRR2R3R4R:((s2/usr/lib64/python2.7/site-packages/dbus/proxies.pyR“s$  (R R!R"RRR(((s2/usr/lib64/python2.7/site-packages/dbus/proxies.pyR#Ls  ,t ProxyObjectcBsòeZdZeZeZdZdZdZ ddde e d„Z ed„dddƒZed„dddƒZed „ddd ƒZdd „Zd „Zd „Zd„Zd„Zd„Zd„Zd„Zdd„Zd„ZeZRS(s£A proxy to the remote Object. A ProxyObject is provided by the Bus. ProxyObjects have member functions, and can be called like normal Python objects. iiic KsÖ|jdd ƒ}|d k re|d k r9tdƒ‚n|}ddlm}|dtddƒn|jdd ƒ} | d k rÊ|d k ržtd ƒ‚n| }ddlm}|d tddƒn|ròtd d j|jƒƒƒ‚n|r|jƒn||_ |d k r*t j |ƒn||_ |_ t j|ƒ||_|sk|j|ƒ|_ nd |_g|_i|_tƒ|_| s¨|jtkr·|j|_n|j|_|jƒ|_d S(søInitialize the proxy object. :Parameters: `conn` : `dbus.connection.Connection` The bus or connection on which to find this object. The keyword argument `bus` is a deprecated alias for this. `bus_name` : str A bus name for the application owning the object, to be used as the destination for method calls and the sender for signal matches. The keyword argument ``named_service`` is a deprecated alias for this. `object_path` : str The object path at which the application exports the object `introspect` : bool If true (default), attempt to introspect the remote object to find out supported methods and their signatures `follow_name_owner_changes` : bool If true (default is false) and the `bus_name` is a well-known name, follow ownership changes for that name tbuss%conn and bus cannot both be specifiediÿÿÿÿ(twarns`Passing the bus parameter to ProxyObject by name is deprecated: please use positional parameterst stacklevelit named_services3bus_name and named_service cannot both be specifiedsjPassing the named_service parameter to ProxyObject by name is deprecated: please use positional parameterss>ProxyObject.__init__ does not take these keyword arguments: %ss, N(R6RR7twarningsR=tDeprecationWarningtjointkeyst_require_main_loopt_busR(tvalidate_bus_nameR&t_requested_bus_nametvalidate_object_patht__dbus_object_path__tactivate_name_ownert_pending_introspectt_pending_introspect_queueR8Rt_introspect_lockR t INTROSPECT_STATE_DONT_INTROSPECTt_introspect_statet'INTROSPECT_STATE_INTROSPECT_IN_PROGRESSt _Introspect( RtconnR.R/t introspecttfollow_name_owner_changestkwargsR<R=R?((s2/usr/lib64/python2.7/site-packages/dbus/proxies.pyR¹sJ              cCs|jS(N(R&(R((s2/usr/lib64/python2.7/site-packages/dbus/proxies.pyt ssèThe bus name to which this proxy is bound. (Read-only, may change.) If the proxy was instantiated using a unique name, this property is that unique name. If the proxy was instantiated with a well-known name and with ``follow_name_owner_changes`` set false (the default), this property is the unique name of the connection that owned that well-known name when the proxy was instantiated, which might not actually own the requested well-known name any more. If the proxy was instantiated with a well-known name and with ``follow_name_owner_changes`` set true, this property is that well-known name. cCs|jS(N(RG(R((s2/usr/lib64/python2.7/site-packages/dbus/proxies.pyRVss[The bus name which was requested when this proxy was instantiated. cCs|jS(N(RI(R((s2/usr/lib64/python2.7/site-packages/dbus/proxies.pyRV$ssThe object-path of this proxy.c Ks1|jj|d|d|d|jd|j|S(sx Arrange for the given function to be called when the given signal is received. :Parameters: `signal_name` : str The name of the signal `handler_function` : callable A function to be called when the signal is emitted by the remote object. Its positional arguments will be the arguments of the signal; optionally, it may be given keyword arguments as described below. `dbus_interface` : str Optional interface with which to qualify the signal name. If None (the default) the handler will be called whenever a signal of the given member name is received, whatever its interface. :Keywords: `utf8_strings` : bool If True, the handler function will receive any string arguments as dbus.UTF8String objects (a subclass of str guaranteed to be UTF-8). If False (default) it will receive any string arguments as dbus.String objects (a subclass of unicode). `byte_arrays` : bool If True, the handler function will receive any byte-array arguments as dbus.ByteArray objects (a subclass of str). If False (default) it will receive any byte-array arguments as a dbus.Array of dbus.Byte (subclasses of: a list of ints). `sender_keyword` : str If not None (the default), the handler function will receive the unique name of the sending endpoint as a keyword argument with this name `destination_keyword` : str If not None (the default), the handler function will receive the bus name of the destination (or None if the signal is a broadcast, as is usual) as a keyword argument with this name. `interface_keyword` : str If not None (the default), the handler function will receive the signal interface as a keyword argument with this name. `member_keyword` : str If not None (the default), the handler function will receive the signal name as a keyword argument with this name. `path_keyword` : str If not None (the default), the handler function will receive the object-path of the sending object as a keyword argument with this name `message_keyword` : str If not None (the default), the handler function will receive the `dbus.lowlevel.SignalMessage` as a keyword argument with this name. `arg...` : unicode or UTF-8 str If there are additional keyword parameters of the form ``arg``\ *n*, match only signals where the *n*\ th argument is the value given for that keyword parameter. As of this time only string arguments can be matched (in particular, object paths and signatures can't). t signal_nameR4R.tpath(REtadd_signal_receiverR&RI(RRWthandler_functionR4R((s2/usr/lib64/python2.7/site-packages/dbus/proxies.pytconnect_to_signal0s < c CsSi}trt|d|jj|||fƒn |||ŽWd|jjƒXdS(N(RMRdRORPRLRRf(RtcallbackRRU((s2/usr/lib64/python2.7/site-packages/dbus/proxies.pyt_introspect_add_to_queue®s  cCs>|jdƒr-|jdƒr-t|ƒ‚n |j|ƒSdS(Nt__(t startswithtendswithtAttributeErrortget_dbus_method(Rtmember((s2/usr/lib64/python2.7/site-packages/dbus/proxies.pyt __getattr__ºscCs[|j||j|j|j||ƒ}|j|jkrW|j||j|jƒ}n|S(s,Return a proxy method representing the given D-Bus method. The returned proxy method can be called in the usual way. For instance, :: proxy.get_dbus_method("Foo", dbus_interface='com.example.Bar')(123) is equivalent to:: proxy.Foo(123, dbus_interface='com.example.Bar') or even:: getattr(proxy, "Foo")(123, dbus_interface='com.example.Bar') However, using `get_dbus_method` is the only way to call D-Bus methods with certain awkward names - if the author of a service implements a method called ``connect_to_signal`` or even ``__getattr__``, you'll need to use `get_dbus_method` to call them. For services which follow the D-Bus convention of CamelCaseMethodNames this won't be a problem. ( tProxyMethodClassRER&RIRORPtDeferredMethodClassRqRo(RRwR4tret((s2/usr/lib64/python2.7/site-packages/dbus/proxies.pyRvÀs  cCs#d|j|j|jt|ƒfS(Ns&(RER&RItid(R((s2/usr/lib64/python2.7/site-packages/dbus/proxies.pyt__repr__æsN(R R!R"R#RyR RzRNRPReRR`RRtpropertyR.trequested_bus_nameR/R[RQRcRaRbRoRqRxRvR}t__str__(((s2/usr/lib64/python2.7/site-packages/dbus/proxies.pyR;¬s6 R     C     & t InterfacecBsÅeZdZd„Zed„dddƒZeZed„dddƒZed„dddƒZ ed„ddd ƒZ ed „ddd ƒZ dd „Z d „Z dd„Zd„ZeZRS(s An interface into a remote object. An Interface can be used to wrap ProxyObjects so that calls can be routed to their correct D-Bus interface. cCs4t|tƒr|j|_n ||_||_dS(s:Construct a proxy for the given interface on the given object. :Parameters: `object` : `dbus.proxies.ProxyObject` or `dbus.Interface` The remote object or another of its interfaces `dbus_interface` : str An interface the `object` implements N(t isinstanceRt proxy_objectt_objR+(RtobjectR4((s2/usr/lib64/python2.7/site-packages/dbus/proxies.pyRôs  cCs |jjS(N(R„R/(R((s2/usr/lib64/python2.7/site-packages/dbus/proxies.pyRVss.The D-Bus object path of the underlying objectcCs |jjS(N(R„R.(R((s2/usr/lib64/python2.7/site-packages/dbus/proxies.pyRVss:The bus name to which the underlying proxy object is boundcCs |jjS(N(R„R(R((s2/usr/lib64/python2.7/site-packages/dbus/proxies.pyRV ssGThe bus name which was requested when the underlying object was createdcCs|jS(N(R„(R((s2/usr/lib64/python2.7/site-packages/dbus/proxies.pyRV ssThe underlying proxy objectcCs|jS(N(R+(R((s2/usr/lib64/python2.7/site-packages/dbus/proxies.pyRVssThe D-Bus interface representedcKs+|s|j}n|jj||||S(saArrange for a function to be called when the given signal is emitted. The parameters and keyword arguments are the same as for `dbus.proxies.ProxyObject.connect_to_signal`, except that if `dbus_interface` is None (the default), the D-Bus interface that was passed to the `Interface` constructor is used. (R+R„R[(RRWRZR4R((s2/usr/lib64/python2.7/site-packages/dbus/proxies.pyR[s  cCsG|jdƒr-|jdƒr-t|ƒ‚n|jj||jƒSdS(NRr(RsRtRuR„RvR+(RRw((s2/usr/lib64/python2.7/site-packages/dbus/proxies.pyRx"scCs+|dkr|j}n|jj||ƒS(s&Return a proxy method representing the given D-Bus method. This is the same as `dbus.proxies.ProxyObject.get_dbus_method` except that if `dbus_interface` is None (the default), the D-Bus interface that was passed to the `Interface` constructor is used. N(RR+R„Rv(RRwR4((s2/usr/lib64/python2.7/site-packages/dbus/proxies.pyRv(s  cCsd|j|jt|ƒfS(Ns%(R„R+R|(R((s2/usr/lib64/python2.7/site-packages/dbus/proxies.pyR}4sN(R R!R"RR~RR/RIR.RRƒR4R[RxRvR}R€(((s2/usr/lib64/python2.7/site-packages/dbus/proxies.pyRìs&          (Rit threadingRt ImportErrortdummy_threadingR(tdbus._expat_introspect_parserRtdbus.exceptionsRRRRt __docformat__t getLoggerRkRRR R R t dbus._compatR R R#R…R;R(((s2/usr/lib64/python2.7/site-packages/dbus/proxies.pyts   "(`ÿA