Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
3
À<×eO ã @ s d dl mZ ddlZddlZddlZddlZddlZddlZ ddl
jZddlZddl
Z
ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ dd lmZ ydd
lmZ dd„ ZW n ek
rÖ dd
lmZ Y nX e jjƒ Zdd„ ZG dd„ dej ƒZ!dS )é )Ú
interfacesé N)Úismethod)Úpolkit)ÚGLib)ÚFunctionType)Ú
DBusException)ÚErrorMessage)Úgetfullargspecc C s t | ƒS )N)r
)Úfunc© r ú#/usr/lib/python3.6/dbus_exporter.pyÚ
getargspec s r )r c C s� t |dd ƒ}|d k rn0t |ddƒdkr4d|jj }nd|j|jjf }t|tƒrZ|jƒ }ndjtj |j|ƒƒ}t
|||ƒ}|jƒ sŒ| j|ƒ d S )NZ_dbus_error_nameÚ
__module__Ú Ú__main__zorg.freedesktop.DBus.Python.%sz!org.freedesktop.DBus.Python.%s.%s)r r )
ÚgetattrÚ __class__Ú__name__r Ú
isinstancer Zget_dbus_messageÚjoinÚ tracebackÚformat_exception_onlyr Zget_no_replyZsend_message)Z
connectionÚmessageZ exceptionÚnameÚcontentsZreplyr r r
Ú_method_reply_error$ s
r c @ s„ e Zd ZdZdd„ Zedd„ ƒZedd„ ƒZedd „ ƒZd
d„ Z dd
„ Z
dd„ Zdd„ Zdd„ Z
dd„ Zdd„ Zdd„ Zdd„ ZdS )Ú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.
c C s” t jƒ tjkrttj_tjjj dd� d | _
d | _i | _t
ƒ | _|| _|| _|| _|| _d | _d | _tƒ | _tjtjƒ}tjƒ | _tjtj|ƒ d S )NT)Zset_as_default)ÚlogZgetEffectiveLevelÚloggingÚDEBUGr ÚdbusÚserviceZmainloopZglibZ
DBusGMainLoopÚ_dbus_object_clsZ_dbus_objectÚ
_dbus_methodsÚsetÚ_signalsÚ _bus_nameÚ_interface_nameÚ_object_nameÚ
_namespaceÚ_threadÚ_bus_objectr Ú_polkitÚsignalÚ getsignalÚSIGINTr ZMainLoopÚ
_main_loop)ÚselfÚbus_nameÚinterface_nameÚobject_nameÚ namespaceZsignal_handlerr r r
Ú__init__B s"
zDBusExporter.__init__c C s | j S )N)r' )r2 r r r
r3 ` s zDBusExporter.bus_namec C s | j S )N)r( )r2 r r r
r4 d s zDBusExporter.interface_namec C s | j S )N)r) )r2 r r r
r5 h s zDBusExporter.object_namec C s
| j d k S )N)r+ )r2 r r r
Úrunningl s zDBusExporter.runningc C sN dj |jdjt|jƒjƒd�}t|dt| jƒ dƒ}t |j
d tƒ |jƒ}|S )Nz2def {name}({args}):
return wrapper({args})
z, )r ÚargszÚexecr )Úformatr r r Ú__func__r9 ÚcompileÚlenr$ r Ú co_constsÚlocals)r2 ÚmethodÚwrapperÚsourceÚcoder r r r
Ú_prepare_for_dbuso s zDBusExporter._prepare_for_dbusc sj t ˆ ƒstdƒ‚ˆ j}|ˆjkr(tdƒ‚‡ ‡fdd„}ˆjˆ |ƒ}tjjˆj||dd�|ƒ}|ˆj|<