File "dbus_exporter.cpython-36.opt-1.pyc"

Full Path: /home/attunedd/public_html/byp/izo/con7ext_sym404/rintoar.txt/lib/python3.6/site-packages/tuned/exports/__pycache__/dbus_exporter.cpython-36.opt-1.pyc
File size: 6.87 KB
MIME-type: text/x-bytecode.python
Charset: 8 bit

3

<eO@sddlmZddlZddlZddlZddlZddlZddlZ	ddl
jZddlZddl
Z
ddlmZddlmZddlmZddlmZddlmZdd	lmZydd
lmZddZWn ek
rdd
lmZYnXe	jjZddZGdddej Z!dS))
interfacesN)ismethod)polkit)GLib)FunctionType)
DBusException)ErrorMessage)getfullargspeccCst|S)N)r
)funcr#/usr/lib/python3.6/dbus_exporter.py
getargspecsr)rcCst|dd}|dk	rn0t|dddkr4d|jj}nd|j|jjf}t|trZ|j}ndjtj	|j|}t
|||}|js|j|dS)NZ_dbus_error_name
__module____main__zorg.freedesktop.DBus.Python.%sz!org.freedesktop.DBus.Python.%s.%s)rr)
getattr	__class____name__r
isinstancerZget_dbus_messagejoin	tracebackformat_exception_onlyr	Zget_no_replyZsend_message)Z
connectionmessageZ	exceptionnamecontentsZreplyrrr
_method_reply_error$s

rc@seZdZdZddZeddZeddZedd	Zd
dZ	dd
Z
ddZddZddZ
ddZddZddZddZdS)DBusExportera+
	Export method calls through DBus Interface.

	We take a method to be exported and create a simple wrapper function
	to call it. This is required as we need the original function to be
	bound to the original object instance. While the wrapper will be bound
	to an object we dynamically construct.
	cCstjtjkrttj_tjjj	ddd|_
d|_i|_t
|_||_||_||_||_d|_d|_t|_tjtj}tj|_tjtj|dS)NT)Zset_as_default)logZgetEffectiveLevelloggingDEBUGrdbusserviceZmainloopZglibZ
DBusGMainLoop_dbus_object_clsZ_dbus_object
_dbus_methodsset_signals	_bus_name_interface_name_object_name
_namespace_thread_bus_objectr_polkitsignal	getsignalSIGINTrZMainLoop
_main_loop)selfbus_nameinterface_nameobject_name	namespaceZsignal_handlerrrr
__init__Bs"
zDBusExporter.__init__cCs|jS)N)r')r2rrr
r3`szDBusExporter.bus_namecCs|jS)N)r()r2rrr
r4dszDBusExporter.interface_namecCs|jS)N)r))r2rrr
r5hszDBusExporter.object_namecCs
|jdk	S)N)r+)r2rrr
runninglszDBusExporter.runningcCsNdj|jdjt|jjd}t|dt|jd}t	|j
dt|j}|S)Nz2def {name}({args}):
					return wrapper({args})
		z, )rargsz<decorator-gen-%d>execr)formatrrr__func__r9compilelenr$r	co_constslocals)r2methodwrappersourcecoderrrr
_prepare_for_dbusoszDBusExporter._prepare_for_dbuscsjtstdj}|jkr(tdfdd}j|}tjjj||dd|}|j|<dS)Nz#Only bound methods can be exported.z*Method with this name is already exported.cs
jdj}|d}tjd||fjj||}|}|dkrXtjd||fn|dkrttjd||fn|dkrtjd||ft|dd
d	g}nZ|dkrtjd
||ft|ddd	g}n(tj	d||ft|ddd	g}||S)N.rz?checking authorization for action '%s' requested by caller '%s'zJaction '%s' requested by caller '%s' was successfully authorized by polkitzepolkit error, but action '%s' requested by caller '%s' was successfully authorized by fallback methodrzLaction '%s' requested by caller '%s' wasn't authorized, ignoring the requestrzppolkit error and action '%s' requested by caller '%s' wasn't authorized by fallback method, ignoring the requestzvpolkit error and unable to use fallback method to authorize action '%s' requested by caller '%s', ignoring the requestrHrHrHrH)
r*rrdebugr-Zcheck_authorizationwarninfolisterror)ownerr9kwargsZ	action_idcallerretZ	args_copy)rAr2rr
rBs$z$DBusExporter.export.<locals>.wrapperrP)Zsender_keyword)	r	Exceptionrr$rEr!r"rAr()r2rAZin_signature
out_signaturemethod_namerBr)rAr2r
export}s
zDBusExporter.exportcsntstdj}||jkr(tdfdd}|j|}tjj|j||}||j|<|j	j
|dS)Nz#Only bound methods can be exported.z*Method with this name is already exported.cs
||S)Nr)rNr9rO)rArr
rBsz$DBusExporter.signal.<locals>.wrapper)rrRrr$rEr!r"r.r(r&add)r2rArSrTrBr)rAr
r.s

zDBusExporter.signalcOsfd}||jks|jdkrd}yt|j|}Wntk
rDd}YnX|rXtd|n
|||dS)NFTzSignal '%s' doesn't exist.)r&r,rAttributeErrorrR)r2r.r9rOerrrArrr
send_signals
zDBusExporter.send_signalcCs<|jdk	rtddt|}t|tjjf|j}||_dS)Nz%The exporter class was already build.zDBusExporter_%d)r#rRidtyper!r"ZObjectr$)r2Zunique_nameclsrrr
_construct_dbus_object_classs

z)DBusExporter._construct_dbus_object_classcCsn|jrdS|jdkr|j|jtj}tjj|j|}|j||j	||_
tj|j
d|_|jjdS)N)target)r8r#r]stopr!Z	SystemBusr"ZBusNamer'r)r,	threadingZThread_thread_coder+start)r2Zbusr3rrr
rbs
zDBusExporter.startcCs2|jdk	r.|jjr.|jj|jjd|_dS)N)r+Zis_aliver1quitr)r2rrr
r_s

zDBusExporter.stopcCs|jj|`d|_dS)N)r1Zrunr,)r2rrr
ras
zDBusExporter._thread_codeN)rr__qualname____doc__r7propertyr3r4r5r8rErUr.rYr]rbr_rarrrr
r8s"
	
r)"rrZdbus.servicer!Zdbus.mainloop.glibZdbus.exceptionsr`r.Z
tuned.logsZtunedZtuned.constsZconstsrrinspectrZtuned.utils.polkitrZ
gi.repositoryrtypesrrZ
dbus.lowlevelr	r
rImportErrorZlogsgetrrZExporterInterfacerrrrr
<module>s.