+
     Gi	  c                   s    ^ RI t^ RIt^ RIHtHt ^ RIHt ^ RIt	^ RI
t
^ RIt^ RIt^ RIHt ]P                  P!                  4       t ! R R]4      tR# )    N)ConfigParserError)InvalidProfileExceptionc                   s|   a  ] tR t^t o Rt. ROtR tR t]R 4       t	]
R 4       tR tR tR tR	 tR
 tR tRtV tR# )Loaderz
Profiles loader.
c                sB    Wn         W n        W0n        W@n        WPn        R # N)_profile_locator_profile_factory_profile_merger_global_config
_variables)selfprofile_locatorZprofile_factoryZprofile_mergerZglobal_config	variabless   &&&&&&:/usr/lib/python3.14/site-packages/tuned/profiles/loader.py__init__ZLoader.__init__   s    ))'%/    c                sT    \         P                  P                  P                  W4      # r   )tunedprofilesprofileZProfile)r   profile_nameconfig   &&&r   _create_profileZLoader._create_profile   s    				'	'	==r   c                s0    \         P                  ! R V4      # )z^[a-zA-Z0-9_.-]+$)reZmatch)Zclsr   s   &&r   	safe_nameZLoader.safe_name   s    	&	55r   c                s    V P                   # r   )r   )r   s   &r   r   ZLoader.profile_locator"   s    			r   c                s   \        V4      \        Jd   VP                  4       p\        \        V P                  V4      4      p\        V4      ^ 8X  d   \        R4      h\        V4      ^8  d-   \        P                  RRP                  V4      ,          4       M#\        P                  RV^ ,          ,          4       . p. pV P                  WV4       V P                  P                  V4      pRP                  V4      Vn        V P                  P                  VP                   4       V P#                  V4       V P%                  V4       V# )r    z.No profile or invalid profiles were specified.zloading profiles: %sz, zloading profile: %sZ )ZtypelistsplitZfilterr   Zlenr   logZinfojoin_load_profiler   Zmergenamer
   Zadd_from_cfgr   _expand_vars_in_devices_expand_vars_in_regexes)r   profile_namesr   processed_filesZfinal_profiles   &&   r   loadZLoader.load&   s   	-$ &&(=vdnnm<=-1	 !Q	RR!88"TYY}%==>88!M!$445(/]o>&&,,X6-xx.-//}667}-}-	r   c                s    VP                    FO  pV P                  P                  VP                   V,          P                  4      VP                   V,          n        KQ  	  R # r   )unitsr
   expandZdevicesr   r   Zunit   && r   r    ZLoader._expand_vars_in_devices>   s?    mmd!%!7!7d8K8S8S!T7== r   c                s\   VP                    F  pV P                  P                  VP                   V,          P                  4      VP                   V,          n        V P                  P                  VP                   V,          P                  4      VP                   V,          n        K  	  R # r   )r%   r
   r&   Zcpuinfo_regexZuname_regexr'   r(   r   r!   ZLoader._expand_vars_in_regexesB   sn    mmd'+'='=gmmD>Q>_>_'`7==$%)__%;%;GMM$<O<[<[%\7==" r   c                sT   V EF   pV P                   P                  WC4      pVR 8X  d   K(  Vf;   \        RV: R\        \	        V P                   P
                  4      4      : R24      hVP                  V4       V P                  V4      pV P                  P                  WF4      pRVP                  9   d\   \        P                  ! RV P                  P                  VP                  P                  R4      4      4      pV P!                  WV4       VP                  V4       EK#  	  R# )Z NzCannot find profile 'z' in 'z'.Zincludez
\s*[,;]\s*)r   Z
get_configr   r   ZreversedZ_load_directoriesZappend_load_config_datar   Zcreateoptionsr   r   r
   r&   Zpopr   )	r   r"   r   r#   r   Zfilenamer   r   Zinclude_namess	   &&&&     r   r   ZLoader._load_profileG   s    d##..tE8"n
!tT\]a]r]r  ^E  ^E  UF  PG  #H  I  I(#""8,6""))$777??"HH]DOO,B,B7??CVCVW`Ca,bcM}@??7 r   c                s0    \         P                  ! R W4      # )z(?<!\\)\$\{i:PROFILE_DIR\})r   Zsub)r   Zprofile_dirZstringr   r   _expand_profile_dirZLoader._expand_profile_dirX   s    	-{	CCr   c                s    \        R RRR7      p\        Vn        \        V4      ;_uu_ 4       pVP	                  W14       RRR4       \        P                  ! 4       p\        P                  P                  T4      p\        TP                  4       4       F  p\        P                  ! 4       YW&   TP                  T4       FG  pTP!                  YxRR7      YW,          T&   T P#                  YeT,          T,          4      YW,          T&   KI  	  YW,          P!                  R4      f   K  \        P                  P%                  YeT,          R,          4      p	\        P                  P'                  T	4      .YW,          R&   K  	  T#   + '       g   i     ELK; i  \
        P                   d   p\        RT,          T4      hRp?ii ; i)	Z=Z#F)Z
delimitersZinline_comment_prefixesZstrictNzCannot parse '%s'.T)ZrawZscript)r   ZstrZoptionxformZopenZ	read_filer   Z	__bases__r   collectionsZOrderedDictosZpathZdirnamer   Zsectionsr*   getr+   r   Znormpath)
r   Z	file_nameZ
config_objZfZer   Zdir_nameZsectionZoptionZscript_paths
   &&        r   r)   ZLoader._load_config_data[   s]   FUZ[::Y1& 	
 ""$&WW__Y'(j))+,g ,,.6?##G,v(nnW$nGFOF"66xQWAXYFOF - o(#/'',,x)BCK!#!1!1+!> ?FOH - 
-! 		 F	 !5	!A1	EEFs4   ,F F F F	F F G+F>>G)r	   r   r   r   r
   N)r   r   r   r	   r
   )Z__name__Z
__module__Z__qualname__Z__firstlineno__Z__doc__Z	__slots__r   r   Zclassmethodr   Zpropertyr   r$   r    r!   r   r+   r)   Z__static_attributes__Z__classdictcell__)Z__classdict__s   @r   r   r      sj      i> 6 6  0U]
"D r   r   )Ztuned.profiles.profiler   Ztuned.profiles.variablesZtuned.utils.config_parserr   r   Ztuned.constsZconstsZos.pathr-   r,   Z
tuned.logsr   Ztuned.profiles.exceptionsr   Zlogsr.   r   Zobjectr   ) r   r   <module>r/      s>      9     	 =jjnnbV br   