o `@sdZddlmZmZmZddlmZmZgdZGdddZ GdddeZ e Z Gd d d eZ Gd d d eZ Gd ddZdS)zcMessages for talking to the DBus daemon itself Generated by jeepney.bindgen and modified by hand. )Message MessageType HeaderFields)MessageGeneratornew_method_call) DBusNameFlagsDBus message_bus MonitoringStats MatchRulec@seZdZdZdZdZdS)rrN)__name__ __module__ __qualname__allow_replacementreplace_existing do_not_queuerr6/usr/lib/python3/dist-packages/jeepney/bus_messages.pyrsrcseZdZdZdZ  d-fdd ZddZd.d d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZddZddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*Zd+d,ZZS)/rz(Messages to talk to the message bus org.freedesktop.DBus/org/freedesktop/DBusctj||ddSN) object_pathbus_namesuper__init__selfrr __class__rrrz DBus.__init__cC t|dS)NHellorr!rrrr& z DBus.HellocCst|dd||fS)N RequestNamesur')r!nameflagsrrrr+"szDBus.RequestNamecCt|dd|fS)N ReleaseNamesr'r!r-rrrr0%zDBus.ReleaseNamecCt|dd|dfS)NStartServiceByNamer,r*r'r2rrrr5(szDBus.StartServiceByNamecCr/)NUpdateActivationEnvironmentza{ss}r')r!envrrrr6,z DBus.UpdateActivationEnvironmentcCr/)N NameHasOwnerr1r'r2rrrr90r3zDBus.NameHasOwnercCr%)N ListNamesr'r(rrrr:3r)zDBus.ListNamescCr%)NListActivatableNamesr'r(rrrr;6r)zDBus.ListActivatableNamescC"t|tr |}t|dd|fS)z4*rule* can be a str or a :class:`MatchRule` instanceAddMatchr1 isinstancer serialiserr!rulerrrr=9s z DBus.AddMatchcCr<)N RemoveMatchr1r>rArrrrC?s zDBus.RemoveMatchcCr/)N GetNameOwnerr1r'r2rrrrDDr3zDBus.GetNameOwnercCr/)NListQueuedOwnersr1r'r2rrrrEGr3zDBus.ListQueuedOwnerscCr/)NGetConnectionUnixUserr1r'r2rrrrFJr3zDBus.GetConnectionUnixUsercCr/)NGetConnectionUnixProcessIDr1r'r2rrrrGMr3zDBus.GetConnectionUnixProcessIDcCr/)NGetAdtAuditSessionDatar1r'r2rrrrHPr3zDBus.GetAdtAuditSessionDatacCr/)N#GetConnectionSELinuxSecurityContextr1r'r2rrrrISr8z(DBus.GetConnectionSELinuxSecurityContextcCr%)N ReloadConfigr'r(rrrrJWr)zDBus.ReloadConfigcCr%)NGetIdr'r(rrrrKZr)z DBus.GetIdcCr/)NGetConnectionCredentialsr1r'r2rrrrL]r3zDBus.GetConnectionCredentialsrr)r*)rrr__doc__ interfacerr&r+r0r5r6r9r:r;r=rCrDrErFrGrHrIrJrKrL __classcell__rrr"rrs2 rcs.eZdZdZ  dfdd ZddZZS) r zorg.freedesktop.DBus.Monitoringrrcrrrr r"rrrer$zMonitoring.__init__cCr4)z:Convert this connection to a monitor connection (advanced) BecomeMonitorasur*r')r!rulesrrrrQiszMonitoring.BecomeMonitorrM)rrrrOrrQrPrrr"rr bs r cs>eZdZdZ  d fdd ZddZdd Zd d ZZS) r z org.freedesktop.DBus.Debug.Statsrrcrrrr r"rrrpr$zStats.__init__cCr%)NGetStatsr'r(rrrrTtr)zStats.GetStatscCr/)NGetConnectionStatsr1r')r!arg0rrrrUwr8zStats.GetConnectionStatscCr%)NGetAllMatchRulesr'r(rrrrW{r)zStats.GetAllMatchRulesrM) rrrrOrrTrUrWrPrrr"rr msr c @s`eZdZdZdddddddddddZdded efd d Zd efd dZde d e fddZ dS)r a>Construct a match rule to subscribe to DBus messages. e.g.:: mr = MatchRule( interface='org.freedesktop.DBus', member='NameOwnerChanged', type='signal' ) msg = message_bus.AddMatch(mr) # Send this message to subscribe to the signal NF)typesenderrOmemberpathpath_namespace destination eavesdropc CsRt|tr t|}||_|||||d} dd| D|_||_||_i|_dS)N)rYrOrZr[r]cSsi|] \}}|dur||qS)Nr.0kvrrr sz&MatchRule.__init__..) r?strr message_typeitems header_fieldsr\r^arg_conditions) r!rXrYrOrZr[r\r]r^fieldsrrrrs  zMatchRule.__init__stringargnovaluecCs@|dvr td||dkr|dkrtd||f|j|<dS)zAdd a condition for a particular argument argno: int, 0-63 kind: 'string', 'path', 'namespace' >r[rj namespacez kind={!r}rmr*z$argno must be 0 for kind='namespace'N) ValueErrorformatrh)r!rkrlkindrrradd_arg_conditions zMatchRule.add_arg_conditionreturncCst|j}|jr|d|jjf|jr|d|jD]\}\}}|dkr,d}|d|||fq ddd|DS) zAConvert to a string to use in an AddMatch call to the message busrX)r^truerjarg,css(|]\}}d||ddVqdS)z{}='{}''z'\''N)roreplacer_rrr s z&MatchRule.serialise..) listrgrfreappendr-r^rhjoin)r!pairsrkvalrprrrr@s  zMatchRule.serialisemsgc CsV|j}|jdur|j|jkrdS|jD]\}}|jt|d|kr'dSq|jdurH|jtjd}|j d}||ksH| |dsHdS|j D][\}\}}|t |j kr]dS|j |} t| tsjdS|dkrv| |krudSqM|dkr| |ks|dr| |s| dr| | sdSqM|dkr| |ks| |dsdSqMd S) z%Returns True if msg matches this ruleNF/rjr[rm.T)headerrergrfrigetrr\r[rstrip startswithrhlenbodyr?rdendswith) r!rhfieldexpectedr[path_nsrkrprurrrmatchessR     zMatchRule.matches)rj) rrrrNrintrdrqr@rboolrrrrrr s   r N)rN low_levelrrrwrappersrr__all__rrr r r r rrrrs J