+
     pht  c                   s    ^ RI t ^ RI Ht ^ RIHt ^ RIHt ^ RIt^ RIHt ^ RI	H
t
 ^ RIHt ^ RIHt ]P                  ! R	4      t]P                  ! R
4      t ! R R4      tR# )i    N)JSONDecodeError)isfile)copyfile)INTERNAL_RESOURCES_PATH)Strategy)ConfigurationParsingException)InvalidStrategyExceptionzconfig.schema.jsonzconfig.jsonc                   sX   a  ] tR t^t o RtRtR tR tR tR t	R t
R tR tR	 tR
tV tR# )ConfigurationNc                s2    Wn         V P                  4        R # )N)pathreload)selfr      &&=/usr/lib/python3.14/site-packages/fw_fanctrl/Configuration.py__init__ZConfiguration.__init__   s    	    c                sN    \         P                  ! V4      pR V9  d6   \         P                  ! \        P	                  R4      4      pVR ,          VR &   \
        P                  ! \         P                  ! \        P	                  R4      4      4      P                  V4       VR,          VR,          9  d   \        RVR,           R24      hVR,          R8w  d,   VR,          VR,          9  d   \        RVR,           R24      hV#   \         d   p\        R	T 24      hR
p?ii ; i)z$schemardefaultStrategy
strategieszDefault strategy 'z' is not a valid strategy.strategyOnDischarging zDischarging strategy 'z"Error parsing configuration file: N)jsonZloadsZloadORIGINAL_CONFIG_PATHopen
jsonschemaZDraft202012ValidatorVALIDATION_SCHEMA_PATHZvalidater   r    )r
   
raw_configZconfigZoriginal_configZes   &&   r   parseZConfiguration.parse   s   	ZZZ
+F&"&)),@,E,Ec,J"K$3I$>y!++DII6L6Q6QRU6V,WXaabhi'(|0DD3(0A)B(CC]^  -."4@W9X`fgs`t9t3,V4K-L,MMgh  M 	Z/2TUVTW0XYY	Zs   DD D$DD$c                s0   \        V P                  4      '       g   \        \        V P                  4       \	        V P                  R 4      ;_uu_ 4       pVP                  4       pRRR4       V P                  X4      V n        R#   + '       g   i     L(; i)r   N)r   r   r   r   r   Zreadr   data)r
   fpr      &  r   r	   ZConfiguration.reload,   s\    dii  )4995$))S!!RJ "JJz*	 "!s   BB	c                s    \         P                  ! V P                  ^R7      p\        V P                  R4      ;_uu_ 4       pVP                  V4       RRR4       R#   + '       g   i     R# ; i)i   )ZindentZwN)r   Zdumpsr   r   r   Zwrite)r
   Zstring_configr   r   r   saveZConfiguration.save3   sD    

499Q7$))S!!RHH]# "!!!s   AA.	c                sD    V P                   R ,          P                  4       # )r   )r   Zkeysr
      &r   get_strategiesZConfiguration.get_strategies8   s    yy&++--r   c                s   VR 8X  d   V P                   V,          pVR8X  d   RpVR8X  d   V P                   V,          pVe   WP                   R,          9  d   \        V4      h\        WP                   R,          V,          4      # )r   r   r   r   )r   r   r   )r
   Zstrategy_namer   r   get_strategyZConfiguration.get_strategy;   su    33 IIm4M" 1-- IIm4M M<9P$P*=99yy'>}'MNNr   c                $    V P                  R 4      # )r   r"   r   r    r   get_default_strategyZ"Configuration.get_default_strategyF   s      !233r   c                r#   )r   r$   r   r    r   get_discharging_strategyZ&Configuration.get_discharging_strategyI   s      !899r   )r   r   )Z__name__Z
__module__Z__qualname__Z__firstlineno__r   r   r   r   r	   r   r!   r"   r%   r&   Z__static_attributes__Z__classdictcell__)Z__classdict__s   @r   r   r      s>     DDZ&+$
.	O4: :r   r   )r   r    Zos.pathr   Zshutilr   r   Z
fw_fanctrlr   Zfw_fanctrl.Strategyr   Z2fw_fanctrl.exception.ConfigurationParsingExceptionr   Z-fw_fanctrl.exception.InvalidStrategyExceptionr   Zjoinpathr   r   r   ) r   r   <module>r'      sM          . ( \ R099:NO .77F 9: 9:r   