AlkantarClanX12

Your IP : 3.128.201.207


Current Path : /lib/python3.6/site-packages/tuned/exports/__pycache__/
Upload File :
Current File : //lib/python3.6/site-packages/tuned/exports/__pycache__/controller.cpython-36.pyc

3

�<�e�
�@s4ddlmZddlZddlZGdd�dejj�ZdS)�)�
interfaces�Ncs�eZdZdZ�fdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Z�ZS)$�ExportsControllerz4
	Controls and manages object interface exporting.
	cs$tt|�j�g|_g|_d|_dS)NF)�superr�__init__�
_exporters�_objects�_exports_initialized)�self)�	__class__�� /usr/lib/python3.6/controller.pyr
szExportsController.__init__cCs|jj|�dS)zRegister objects exporter.N)r�append)r
�instancerrr
�register_exportersz#ExportsController.register_exportercCs|jj|�dS)zRegister object to be exported.N)rr)r
rrrr
�register_objectsz!ExportsController.register_objectcCstj|�ot|d�S)z8Check if method was marked with @exports.export wrapper.�
export_params)�inspect�ismethod�hasattr)r
�methodrrr
�_is_exportable_methodsz'ExportsController._is_exportable_methodcCstj|�ot|d�S)z8Check if method was marked with @exports.signal wrapper.�
signal_params)rrr)r
rrrr
�_is_exportable_signalsz'ExportsController._is_exportable_signalcCstj|�ot|d�S)z>Check if method was marked with @exports.get_property wrapper.�property_get_params)rrr)r
rrrr
�_is_exportable_getter sz'ExportsController._is_exportable_gettercCstj|�ot|d�S)z>Check if method was marked with @exports.set_property wrapper.�property_set_params)rrr)r
rrrr
�_is_exportable_setter$sz'ExportsController._is_exportable_settercCs:x4|jD]*}|jd}|jd}|j|f|�|�qWdS)z!Register method to all exporters.rrN)rrZexport)r
r�exporter�args�kwargsrrr
�_export_method(s

z ExportsController._export_methodcCs:x4|jD]*}|jd}|jd}|j|f|�|�qWdS)z!Register signal to all exporters.rrN)rr�signal)r
rrrr rrr
�_export_signal/s

z ExportsController._export_signalcCs:x4|jD]*}|jd}|jd}|j|f|�|�qWdS)z*Register property getter to all exporters.rrN)rrZproperty_getter)r
rrrr rrr
�_export_getter6s

z ExportsController._export_gettercCs:x4|jD]*}|jd}|jd}|j|f|�|�qWdS)z*Register property setter to all exporters.rrN)rrZproperty_setter)r
rrrr rrr
�_export_setter=s

z ExportsController._export_settercOs&x |jD]}|j|f|�|�qWdS)z!Register signal to all exporters.N)r�send_signal)r
r"rr rrrr
r&DszExportsController.send_signalcOs x|jD]}|j||�qWdS)N)r�property_changed)r
rr rrrr
r'Isz"ExportsController.property_changedcCsx|jD]}|j�qWdS)z=Allows to perform checks on exporters without special thread.N)r�period_check)r
rrrr
r(MszExportsController.period_checkcCs�|jr
dSx�|jD]�}x$tj||j�D]\}}|j|�q&Wx$tj||j�D]\}}|j|�qLWx$tj||j�D]\}}|j	|�qrWx$tj||j
�D]\}}|j|�q�WqWd|_dS)NT)r	rrZ
getmembersrr!rr#rr$rr%)r
r�namerrrr
�_initialize_exportsRsz%ExportsController._initialize_exportscCs$|j�x|jD]}|j�qWdS)zStart the exports.N)r*r�start)r
rrrr
r+bszExportsController.startcCsx|jD]}|j�qWdS)zStop the exports.N)r�stop)r
rrrr
r,hszExportsController.stop)�__name__�
__module__�__qualname__�__doc__rrrrrrrr!r#r$r%r&r'r(r*r+r,�
__classcell__rr)rr
rs$r)�rrZtuned.patternsZtunedZpatternsZ	Singletonrrrrr
�<module>s