MINI MINI MANI MO

Path : /usr/lib/python2.7/site-packages/tuned/exports/
File Upload :
Current File : //usr/lib/python2.7/site-packages/tuned/exports/dbus_exporter.pyo

ó
©=[c@sËddlmZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Zddlj
Z
ddlmZddlmZejjƒZdejfd„ƒYZdS(i(t
interfacesiÿÿÿÿN(tpolkit(tGLibtDBusExportercBsŒeZdZd„Zed„ƒZed„ƒZed„ƒZd„Zd„Z	d„Z
d„Zd	„Zd
„Z
d„Zd„ZRS(
s+
	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.
	cCs®tjjjdtƒd|_d|_i|_t	ƒ|_
||_||_||_
d|_d|_tƒ|_tjtjƒ}tjƒ|_tjtj|ƒdS(Ntset_as_default(tdbustmainlooptglibt
DBusGMainLooptTruetNonet_dbus_object_clst_dbus_objectt
_dbus_methodstsett_signalst	_bus_namet_interface_namet_object_namet_threadt_bus_objectRt_polkittsignalt	getsignaltSIGINTRtMainLoopt
_main_loop(tselftbus_nametinterface_nametobject_nametsignal_handler((s?/usr/lib/python2.7/site-packages/tuned/exports/dbus_exporter.pyt__init__s								cCs|jS(N(R(R((s?/usr/lib/python2.7/site-packages/tuned/exports/dbus_exporter.pyR/scCs|jS(N(R(R((s?/usr/lib/python2.7/site-packages/tuned/exports/dbus_exporter.pyR3scCs|jS(N(R(R((s?/usr/lib/python2.7/site-packages/tuned/exports/dbus_exporter.pyR7scCs
|jdk	S(N(RR
(R((s?/usr/lib/python2.7/site-packages/tuned/exports/dbus_exporter.pytrunning;scs¤tjˆƒstdƒ‚nˆj}|ˆjkrEtdƒ‚n‡‡fd†}tj|ˆjƒ}tjj	ˆj
||ddƒ|ƒ}|ˆj|<dS(Ns#Only bound methods can be exported.s*Method with this name is already exported.cs$tjdˆj}|d}tjd||fƒˆjj||ƒ}|dkrptjd||fƒn§|dkr–tjd||fƒn|dkrÆtjd	||fƒd
|d<nQ|dkrötjd||fƒd
|d<n!tj	d||fƒd
|d<ˆ||ŽS(
Nt.iÿÿÿÿsCchecking authorization for for action '%s' requested by caller '%s'isJaction '%s' requested by caller '%s' was successfully authorized by polkitisepolkit error, but action '%s' requested by caller '%s' was successfully authorized by fallback methodisLaction '%s' requested by caller '%s' wasn't authorized, ignoring the requesttsppolkit error and action '%s' requested by caller '%s' wasn't authorized by fallback method, ignoring the requestsvpolkit error and unable to use fallback method to authorize action '%s' requested by caller '%s', ignoring the request(
tconstst	NAMESPACEt__name__tlogtdebugRtcheck_authorizationtwarntinfoterror(twrappedtownertargstkwargst	action_idtcallertret(tmethodR(s?/usr/lib/python2.7/site-packages/tuned/exports/dbus_exporter.pytwrapperFs"



tsender_keywordR2(tinspecttismethodt	ExceptionR&R
t	decoratort__func__RtserviceR4R(RR4tin_signaturet
out_signaturetmethod_nameR5((R4Rs?/usr/lib/python2.7/site-packages/tuned/exports/dbus_exporter.pytexport>s	'cs¨tjˆƒstdƒ‚nˆj}||jkrEtdƒ‚n‡fd†}tj|ˆjƒ}tjj	|j
|ƒ|ƒ}||j|<|jj|ƒdS(Ns#Only bound methods can be exported.s*Method with this name is already exported.cs
ˆ||ŽS(N((R-R.R/R0(R4(s?/usr/lib/python2.7/site-packages/tuned/exports/dbus_exporter.pyR5gs(
R7R8R9R&R
R:R;RR<RRRtadd(RR4R>R?R5((R4s?/usr/lib/python2.7/site-packages/tuned/exports/dbus_exporter.pyR_s	
cOs‡t}||jks$|jdkr-t}nyt|j|ƒ}Wntk
r\t}nX|rvtd|ƒ‚n
|||ŽdS(NsSignal '%s' doesn't exist.(tFalseRRR
R	tgetattrtAttributeErrorR9(RRR/R0terrR4((s?/usr/lib/python2.7/site-packages/tuned/exports/dbus_exporter.pytsend_signalps	

cCsY|jdk	rtdƒ‚ndt|ƒ}t|tjjf|jƒ}||_dS(Ns%The exporter class was already build.sDBusExporter_%d(	RR
R9tidttypeRR<tObjectR
(Rtunique_nametcls((s?/usr/lib/python2.7/site-packages/tuned/exports/dbus_exporter.pyt_construct_dbus_object_class}s
cCsž|jƒrdS|jdkr,|jƒn|jƒtjƒ}tjj|j	|ƒ}|j||j
|ƒ|_tj
d|jƒ|_|jjƒdS(Nttarget(R!RR
RLtstopRt	SystemBusR<tBusNameRRRt	threadingtThreadt_thread_codeRtstart(RtbusR((s?/usr/lib/python2.7/site-packages/tuned/exports/dbus_exporter.pyRT†s

cCsH|jdk	rD|jjƒrD|jjƒ|jjƒd|_ndS(N(RR
tis_aliveRtquittjoin(R((s?/usr/lib/python2.7/site-packages/tuned/exports/dbus_exporter.pyRN“s

cCs |jjƒ|`d|_dS(N(RtrunRR
(R((s?/usr/lib/python2.7/site-packages/tuned/exports/dbus_exporter.pyRS™s
(R&t
__module__t__doc__R tpropertyRRRR!R@RRFRLRTRNRS(((s?/usr/lib/python2.7/site-packages/tuned/exports/dbus_exporter.pyRs			!		
			
	(R#RR:tdbus.serviceRtdbus.mainloop.glibtdbus.exceptionsR7RQRt
tuned.logsttunedttuned.constsR$ttuned.utils.polkitRt
gi.repositoryRtlogstgetR'tExporterInterfaceR(((s?/usr/lib/python2.7/site-packages/tuned/exports/dbus_exporter.pyt<module>s

OHA YOOOO