@iasD(dZdZddlZddlZddlmZmZmZmZm Z m Z m Z m Z m Z mZmZmZmZmZmZmZmZmZmZmZmZmZmZddlmZddlmZddl m!Z!ddl"m#Z#d ed ed ed Z$ d Z%ej&dZ'Gdde(Z)GddeZ*dS)) BusConnectionreStructuredTextN)BUS_DAEMON_IFACEBUS_DAEMON_NAMEBUS_DAEMON_PATH BUS_SESSION BUS_STARTER BUS_SYSTEM DBUS_START_REPLY_ALREADY_RUNNINGDBUS_START_REPLY_SUCCESSNAME_FLAG_ALLOW_REPLACEMENTNAME_FLAG_DO_NOT_QUEUENAME_FLAG_REPLACE_EXISTINGRELEASE_NAME_REPLY_NON_EXISTENTRELEASE_NAME_REPLY_NOT_OWNERRELEASE_NAME_REPLY_RELEASED REQUEST_NAME_REPLY_ALREADY_OWNERREQUEST_NAME_REPLY_EXISTSREQUEST_NAME_REPLY_IN_QUEUE REQUEST_NAME_REPLY_PRIMARY_OWNERvalidate_bus_namevalidate_error_namevalidate_interface_namevalidate_member_namevalidate_object_path) Connection) DBusException)HANDLER_RESULT_NOT_YET_HANDLED)is_py2ztype='signal',sender='z ',interface='z"',member='NameOwnerChanged',path='z ',arg0='%s'z)org.freedesktop.DBus.Error.NameHasNoOwnerzdbus.busceZdZdZdZdZdS)NameOwnerWatch)_match _pending_callc tfd}fd}||dttt|_|tttddf||_dS)Nc|dSN)owned old_owner new_ownercallbacks */usr/lib/python3/dist-packages/dbus/bus.py signal_cbz*NameOwnerWatch.__init__..signal_cbBs HY     c|tkr ddStjtd|j|dfdS)NzGetNameOwner(%s) failed:)exc_info) get_dbus_name_NAME_HAS_NO_OWNERlogging basicConfig_loggerdebug __class__)ebus_namer+s r,error_cbz)NameOwnerWatch.__init__..error_cbEso  $666 #%%% 8(() Q'=?????r.NameOwnerChanged)arg0 GetNameOwners)radd_signal_receiverrrrr" call_asyncr#)selfbus_connr:r+r-r;s `` r,__init__zNameOwnerWatch.__init__?s(###      ? ? ? ? ? ?2293E3C3B3B8@ 3BB &001@1A1?14xk198 EEr.c|j|j|j|jd|_d|_dSr&)r"remover#cancelrBs r,rGzNameOwnerWatch.cancelZsQ ; " K     )   % % ' ' ' !r.N)__name__ __module__ __qualname__ __slots__rDrGr'r.r,r!r!<s:+IEEE6"""""r.r!ceZdZdZeZ eZ eZ e Z e Z edfdZ dfd ZdZdZ dd Zd Zdd Zdd ZdZdZdZdZdZdZdZdZdZdZxZ S)rzxA connection to a D-Bus daemon that implements the ``org.freedesktop.DBus`` pseudo-service. :Since: 0.81.0 Nct|||}tj|_i|_ |S)N)mainloop) _new_for_busweakrefWeakValueDictionary _bus_names_signal_sender_matches)clsaddress_or_typerObuss r,__new__zBusConnection.__new__ws<BB!466%'"5 r.c  |dd}|,|td|}ddlm}|dtdt t |j|||||fi| |F|tkr;|ddd kr fd } n j } | || } | |j <| t  S) N named_service3bus_name and named_service cannot both be specifiedrwarnzrPassing the named_service parameter to add_signal_receiver by name is deprecated: please use positional parameters stacklevel:c@|dkrdSdS)Nr0)rF)r*matchs r,r+z3BusConnection.add_signal_receiver..callbacks$ B 'r.)pop TypeErrorwarningsr]DeprecationWarningsuperrr@rset_sender_name_ownerwatch_name_ownerrTadd_match_stringstr) rBhandler_function signal_namedbus_interfacer:pathkeywordsrZr]r+watchrdr8s @r,r@z!BusConnection.add_signal_receivers>! _d;;  $#!,---$H % % % % % % DK# 3 3 3 3?mT**> +~x"" ""  X%@%@|s""''''''!6))(H==E16D ' . c%jj))) r.c|t||j|d}||dSdSr&) remove_match_string_non_blockingrmrTrerG)rBrdrss r,_clean_up_signal_matchz$BusConnection._clean_up_signal_matchsS --c%jj999+//t<<   LLNNNNN  r.c&||dddkr|tkru ||S#t$rR}|tkr||||cYd}~Sd}~wwxYw|S)Nrarb)rget_name_ownerrr2r3start_service_by_name)rBr:r9s r,activate_name_ownerz!BusConnection.activate_name_owners  Xbqb\S%8%8O++ 5**8444  5 5 5??$$(:::**8444**844444444  5Os2 BAB B BTFc \|r||dd}|,|tdddlm}|dt d|}|r7td d |z|||||| S) aJReturn a local proxy for the given remote object. Method calls on the proxy are translated into method calls on the remote object. :Parameters: `bus_name` : str A bus name (either the unique name or a well-known name) of the application owning the object. The keyword argument named_service is a deprecated alias for this. `object_path` : str The object path of the desired 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 the object path is a well-known name and this parameter is false (default), resolve the well-known name to the unique name of its current owner and bind to that instead; if the ownership of the well-known name changes in future, keep communicating with the original owner. This is necessary if the D-Bus API used is stateful. If the object path is a well-known name and this parameter is true, whenever the well-known name changes ownership in future, bind to the new owner, if any. If the given object path is a unique name, this parameter has no effect. :Returns: a `dbus.proxies.ProxyObject` :Raises `DBusException`: if resolving the well-known name to a unique name fails rZNr[rr\ziPassing the named_service parameter to get_object by name is deprecated: please use positional parametersr^r_z4get_object does not take these keyword arguments: %sz, ) introspectfollow_name_owner_changes) _require_main_looprerfrgr]rhjoinkeysProxyObjectClass)rBr: object_pathr|r}kwargsrZr]s r, get_objectzBusConnection.get_objectsH % &  # # % % % ?D99  $#!/000 % % % % % % DC# 3 3 3 3%H  H,.2ii .F.FGHH H$$T8[0:?X%ZZ Zr.ctt||tttdd|fS)zGet the numeric uid of the process owning the given bus name. :Parameters: `bus_name` : str A bus name, either unique or well-known :Returns: a `dbus.UInt32` :Since: 0.80.0 GetConnectionUnixUserr?r call_blockingrrrrBr:s r, get_unix_userzBusConnection.get_unix_users; (###!!/?"24K"%{44 4r.rc zt|d|tttdd||ffS)a?Start a service which will implement the given bus name on this Bus. :Parameters: `bus_name` : str The well-known bus name to be activated. `flags` : dbus.UInt32 Flags to pass to StartServiceByName (currently none are defined) :Returns: A tuple of 2 elements. The first is always True, the second is either START_REPLY_SUCCESS or START_REPLY_ALREADY_RUNNING. :Raises `DBusException`: if the service could not be started. :Since: 0.80.0 TStartServiceByNamesur)rBr:flagss r,ryz#BusConnection.start_service_by_namesI" (###d((/)9)=)-%/@BBC Cr.c zt|d|tttdd||fS)aRequest a bus name. :Parameters: `name` : str The well-known name to be requested `flags` : dbus.UInt32 A bitwise-OR of 0 or more of the flags `NAME_FLAG_ALLOW_REPLACEMENT`, `NAME_FLAG_REPLACE_EXISTING` and `NAME_FLAG_DO_NOT_QUEUE` :Returns: `REQUEST_NAME_REPLY_PRIMARY_OWNER`, `REQUEST_NAME_REPLY_IN_QUEUE`, `REQUEST_NAME_REPLY_EXISTS` or `REQUEST_NAME_REPLY_ALREADY_OWNER` :Raises `DBusException`: if the bus daemon cannot be contacted or returns an error. F allow_unique RequestNamerr)rBnamers r, request_namezBusConnection.request_namesA$ $U3333!!/?"2M"&u 77 7r.cxt|d|tttdd|fS)asRelease a bus name. :Parameters: `name` : str The well-known name to be released :Returns: `RELEASE_NAME_REPLY_RELEASED`, `RELEASE_NAME_REPLY_NON_EXISTENT` or `RELEASE_NAME_REPLY_NOT_OWNER` :Raises `DBusException`: if the bus daemon cannot be contacted or returns an error. Fr ReleaseNamer?r)rBrs r, release_namezBusConnection.release_name/s? $U3333!!/?"2M"%w00 0r.cT|tttdddS)zReturn a list of all currently-owned names on the bus. :Returns: a dbus.Array of dbus.UTF8String :Since: 0.81.0 ListNamesr0r'rrrrrHs r, list_nameszBusConnection.list_names@s* !!/?"2K"$b** *r.cT|tttdddS)zReturn a list of all names that can be activated on the bus. :Returns: a dbus.Array of dbus.UTF8String :Since: 0.81.0 ListActivatableNamesr0r'rrHs r,list_activatable_namesz$BusConnection.list_activatable_namesJs+ !!/?"24J"$b** *r.cxt|d|tttdd|fS)zReturn the unique connection name of the primary owner of the given name. :Raises `DBusException`: if the `bus_name` has no owner :Since: 0.81.0 Frr>r?rrs r,rxzBusConnection.get_name_ownerTs? (7777!!/?"2N"%{44 4r.c$t|||S)aWatch the unique connection name of the primary owner of the given name. `callback` will be called with one argument, which is either the unique connection name, or the empty string (meaning the name is not owned). :Since: 0.81.0 )r!)rBr:r+s r,rkzBusConnection.watch_name_owner`sdHh777r.c pt|tttdd|fS)zReturn True iff the given bus name has an owner on this bus. :Parameters: `bus_name` : str The bus name to look up :Returns: a `bool` NameHasOwnerr?)boolrrrrrs r,name_has_ownerzBusConnection.name_has_ownerls8D&&'7'*XK99:: :r.cZ|tttdd|fdS)Arrange for this application to receive messages on the bus that match the given rule. This version will block. :Parameters: `rule` : str The match rule :Raises `DBusException`: on error. :Since: 0.80.0 AddMatchr?NrrBrules r,rlzBusConnection.add_match_stringxs: ?O+Ztg G G G G Gr.c ^|tttdd|fdddS)=Arrange for this application to receive messages on the bus that match the given rule. This version will not block, but any errors will be ignored. :Parameters: `rule` : str The match rule :Raises `DBusException`: on error. :Since: 0.80.0 rr?NrArrrrs r,add_match_string_non_blockingz+BusConnection.add_match_string_non_blockings8 (*cD7d $ $ $ $ $r.cZ|tttdd|fdS)r RemoveMatchr?Nrrs r,remove_match_stringz!BusConnection.remove_match_strings: ?O+]C$ J J J J Jr.c ^|tttdd|fdddS)rrr?Nrrs r,ruz.BusConnection.remove_match_string_non_blockings8 (-tgd $ $ $ $ $r.)NNNN)TF)r)!rIrJrK__doc__r TYPE_SESSIONr TYPE_SYSTEMr TYPE_STARTERr START_REPLY_SUCCESSr START_REPLY_ALREADY_RUNNINGrXr@rvrzrrryrrrrrxrkrrlrrru __classcell__)r8s@r,rrcs "LH KHL$3"B%1D    AE:>!%@   <@-27Z7Z7Z7Zr 4 4 4CCCC27777.000"****** 4 4 4 8 8 8 : : : G G G$$$ J J J$$$$$$$r.r)+__all__ __docformat__r4rQ_dbus_bindingsrrrrr r r r r rrrrrrrrrrrrrrdbus.connectionrdbus.exceptionsr dbus.lowlevelr dbus._compatr_NAME_OWNER_CHANGE_MATCHr3 getLoggerr6objectr!rr'r.r,rsF2 "  I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I'&&&&&))))))888888 /0@0@0@. 0  A ' J ' '$"$"$"$"$"V$"$"$"NO$O$O$O$O$JO$O$O$O$O$r.