o
    •Û_n  ã                   @   s0   d dl Zd dlmZ d dlZG dd„ deƒZdS )é    Nc                   @   sj   e Zd ZdZg d¢Zdd„ Zdd„ Zdd„ Zd	d
„ Ze	dd„ ƒZ
e
jdd„ ƒZ
e	dd„ ƒZe	dd„ ƒZdS )ÚProfilez'
	Representation of a tuning profile.
	)Ú_nameÚ_optionsÚ_unitsc                 C   s   || _ |  |¡ |  |¡ d S ©N)r   Ú_init_optionsÚ_init_units©ÚselfÚnameÚconfig© r   ú8/usr/lib/python3/dist-packages/tuned/profiles/profile.pyÚ__init__   s   
zProfile.__init__c                 C   s(   i | _ tj|v rt|tj ƒ| _ d S d S r   )r   ÚconstsÚPLUGIN_MAIN_UNIT_NAMEÚdict)r
   r   r   r   r   r      s   
ÿzProfile._init_optionsc                 C   s<   t  ¡ | _|D ]}|tjkr|  ||| ¡}|| j|< qd S r   )ÚcollectionsÚOrderedDictr   r   r   Ú_create_unit)r
   r   Ú	unit_nameÚnew_unitr   r   r   r      s   


€ýzProfile._init_unitsc                 C   s   t jj ||¡S r   )ÚtunedÚprofilesÚunitÚUnitr	   r   r   r   r      s   zProfile._create_unitc                 C   ó   | j S )z
		Profile name.
		©r   ©r
   r   r   r   r       ó   zProfile.namec                 C   s
   || _ d S r   r   )r
   Úvaluer   r   r   r   '   s   
c                 C   r   )z$
		Units included in the profile.
		)r   r   r   r   r   Úunits+   r   zProfile.unitsc                 C   r   )z
		Profile global options.
		)r   r   r   r   r   Úoptions2   r   zProfile.optionsN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__r   r   r   r   Úpropertyr   Úsetterr!   r"   r   r   r   r   r      s    


r   )Útuned.profiles.unitr   Útuned.constsr   r   Úobjectr   r   r   r   r   Ú<module>   s    