a ]i@sTddlmZddlmZmZddlmZddlmZddl m Z Gddde Z dS) )ismethod)methodsignal)PROPERTIES_IFACE) DBusException) DBusExportercs@eZdZfddZddZddZd dd Zd d d ZZS)DBusExporterWithPropertiesc stt||||i_i_fdd}fdd}fdd}fdd}ttd d d d |jd <ttdd d|jd<ttddd d |jd<ttdd|jd<j ddS)Ncs>|jkrtd||jvr,td|j|}||SNUnknown interface: %szNo such property: %s)_interface_namer_property_getters)_interface_name property_namecallergetterselfO/usr/lib/python3.9/site-packages/tuned/exports/dbus_exporter_with_properties.pyGets      z0DBusExporterWithProperties.__init__..GetcsD|jkrtd||jvr,td|j|}|||dSr )r r_property_setters)r rrvaluersetterrrrSets      z0DBusExporterWithProperties.__init__..Setcs.|jkrtd|fddjDS)Nr csi|]\}}||qSrr).0namerrrr !zGDBusExporterWithProperties.__init__..GetAll..)r rr items)r rrrrrGetAlls  z3DBusExporterWithProperties.__init__..GetAllcs|jkrtd|dS)Nr )r r)r rZchanged_propertiesZinvalidated_propertiesrrrPropertiesChanged#s z>DBusExporterWithProperties.__init__..PropertiesChangedssvr) in_signatureZ out_signaturesender_keywordrZssv)r%r&rsza{sv}r!zsa{sv}as)Z signaturer") superr__init__rr rrZ _dbus_methodsrZ_signalsadd) rZbus_namerZ object_name namespacerrr!r" __class__rrr) s    z#DBusExporterWithProperties.__init__csfdd}|S)Ncs4jg|R}|ddkr&td|i|S)NZ Unauthorized)Z _polkit_authr)argskwargsnew_args action_namerrrrwrapper.s z9DBusExporterWithProperties._auth_wrapper..wrapperr)rrr4r5rr3r _auth_wrapper-sz(DBusExporterWithProperties._auth_wrappercCs|d|j||iidS)Nr")Z send_signalr )rrrrrrproperty_changed5sz+DBusExporterWithProperties.property_changedNcCsDt|std||jvr"td|dur6|||}||j|<dS)N#Only bound methods can be exported.z1A getter for this property is already registered.)r Exceptionr r6rrrr4rrrproperty_getter8s  z*DBusExporterWithProperties.property_gettercCsDt|std||jvr"td|dur6|||}||j|<dS)Nr8z1A setter for this property is already registered.)rr9rr6r:rrrproperty_setterAs  z*DBusExporterWithProperties.property_setter)N)N) __name__ __module__ __qualname__r)r6r7r;r< __classcell__rrr,rrs  $ rN) inspectrZ dbus.servicerrZdbusrZdbus.exceptionsrZtuned.exports.dbus_exporterrrrrrrs