✏️ 编辑:dbus_exporter.cpython-39.opt-1.pyc
路径:
/usr/lib/python3.9/site-packages/tuned/exports/__pycache__/dbus_exporter.cpython-39.opt-1.pyc
大小:7.09 KB · 修改:2026-07-21 16:54:01 · 权限:0644 · 只读(保存会失败)
← 返回目录
👁 查看
⬇ 下载
检测到二进制内容,直接保存可能损坏文件。请改用「上传替换」。
a �]�i� � @ s d dl mZ ddlZddlZddlZddlZddlZddlZ ddl mZ ddlZddl Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ dd lmZ zdd lmZ dd� ZW n ey� dd lmZ Y n0 e j�� Zdd� ZG dd� dej �Z!dS )� )� interfaces� N)�ismethod)�polkit)�GLib)�FunctionType)� DBusException)�ErrorMessage��getfullargspecc C s t | �S �Nr )�func� r �?/usr/lib/python3.9/site-packages/tuned/exports/dbus_exporter.py� getargspec s r )r c C s� t |dd �}|d urn0t |dd�dv r4d|jj }nd|j|jjf }t|t�rZ|�� }nd�t� |j|��}t |||�}|�� s�| �|� d S )NZ_dbus_error_name� __module__� )r �__main__zorg.freedesktop.DBus.Python.%sz!org.freedesktop.DBus.Python.%s.%s) �getattr� __class__�__name__r � isinstancer Zget_dbus_message�join� traceback�format_exception_onlyr Zget_no_replyZsend_message)Z connection�message� exception�name�contentsZreplyr r r �_method_reply_error$ s �r c @ s� e Zd ZdZdd� Zedd� �Zedd� �Zedd � �Zd d� Z dd � Z dd� Zddd�Zdd� Z dd� Zdd� 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 �� tjkrttj_tjjj dd� d | _ d | _i | _t � | _|| _|| _|| _|| _d | _d | _t� | _t�tj�}t�� | _t�tj|� 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"