← Back
Editing: dbus_exporter.cpython-312.pyc
� �]�i� � �> � d dl mZ ddlZddlZddlZddlZddlZddlZ ddl mZ ddlZddl Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ dd lmZ dd lmZ d� Ze j8 j; � Zd � Z G d� dej@ � Z!y# e$ r ddlmZ Y �@w xY w)� )� interfaces� N)�ismethod)�polkit)�GLib)�FunctionType)� DBusException)�ErrorMessage��getfullargspecc � � t | � S �Nr )�funcs �@/usr/lib/python3.12/site-packages/tuned/exports/dbus_exporter.py� getargspecr s � � �� �� )r c � � t |dd � }|�nOt |dd� dv rd|j j z }n&d|j �d|j j ��}t |t � r|j � }n/dj t j |j |� � }t |||� }|j � s| j |� y y )N�_dbus_error_name� __module__� )r �__main__zorg.freedesktop.DBus.Python.%szorg.freedesktop.DBus.Python.�.) �getattr� __class__�__name__r � isinstancer �get_dbus_message�join� traceback�format_exception_onlyr �get_no_reply�send_message)� connection�message� exception�name�contents�replys r �_method_reply_errorr) $ s� � ��9�0�$�7�D���� ��L�"� -�1A� A�/�)�2E�2E�2N�2N�N�� B� 7@�6J�6J�I�L_�L_�Lh�Lh�i���)�]�+��-�-�/���7�7�9�:�:�9�;N�;N��� ����$��1�E����!�����&� "r c � � e Zd ZdZd� Zed� � Zed� � Zed� � Zd� Z d� Z d� Zdd �Zd� Z d� Zd � Zd� Zd� Zd� Zy )�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 �N � t j � t j k7 rt t j _ t j j j d�� d | _ d | _ i | _ t � | _ || _ || _ || _ || _ d | _ d | _ t+ � | _ t/ j0 t. j2 � }t5 j6 � | _ t/ j. t. j2 |� y )NT)�set_as_default)�log�getEffectiveLevel�logging�DEBUGr) �dbus�service�mainloop�glib� DBusGMainLoop�_dbus_object_cls�_dbus_object� _dbus_methods�set�_signals� _bus_name�_interface_name�_object_name� _namespace�_thread�_bus_objectr �_polkit�signal� getsignal�SIGINTr �MainLoop� _main_loop)�self�bus_name�interface_name�object_name� namespace�signal_handlers r �__init__zDBusExporter.__init__B s� � � ����� � �-�&9�4�<�<�#��-�-���"�"�$�"�7��$���$���$���%�$�-��$�.�'�$��!�$���$�/��$�,��$����$�,� �#�#�F�M�M�2�.��M�M�O�$�/��-�-�� � �~�.r c � � | j S r )r<