Spade
Mini Shell
| Directory:~$ /lib/python2.7/site-packages/tuned/exports/ |
| [Home] [System Details] [Kill Me] |
�
��\c@s�ddlmZddlZddlZddlZddlZddlZddlZddl Z ddl
Zddlj
Z
ddlmZddlmZejj�Zdejfd��YZdS(i(t
interfacesi����N(tpolkit(tGLibtDBusExportercBs�eZdZd�Zed��Zed��Zed��Zd�Zd�Z d�Z
d�Zd �Zd
�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(RR4tin_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
|�|_tj
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:tdbus.serviceRtdbus.mainloop.glibtdbus.exceptionsR7RQRt
tuned.logsttunedttuned.constsR$ttuned.utils.polkitRt
gi.repositoryRtlogstgetR'tExporterInterfaceR(((s?/usr/lib/python2.7/site-packages/tuned/exports/dbus_exporter.pyt<module>s