
    1it                     4    S SK Jr  S SKr " S S\5      rS rg)    wrapsNc                   .   ^  \ rS rSrU 4S jrS rSrU =r$ )NoTimeZoneInfoError   c                 8   > Xl         X l        [        TU ]  " U6   g )N)argnamedtsuper__init__)selfr	   r
   args	__class__s       W/var/www/html/motor_solar_iot/venv/lib/python3.13/site-packages/pysolar/tzinfo_check.pyr   NoTimeZoneInfoError.__init__   s    LG	Gd    c                 J    SR                  U R                  U R                  S9$ )Nzdatetime value '{dt}' given for arg '{argname}' should be made timezone-aware.
You have to specify the 'tzinfo' attribute of 'datetime.datetime' objects.)r
   r	   )formatr
   r	   )r   s    r   __str__NoTimeZoneInfoError.__str__   s*      !'$''/3|| !' !==r   )r	   r
   )__name__
__module____qualname____firstlineno__r   r   __static_attributes____classcell__)r   s   @r   r   r      s    
= =r   r   c                     ^  U 4S jnU$ )aN  Returns a decorator that makes sure that
all the arguments in 'argnames', are 'datetime.datetime' objects
with a non-null tzinfo attribute

Parameters
----------
argnames : List[str]
  list of names from the arguments of function 'func'
  (the decorated function) that are supposed to only accept
  as values 'datetime.datetime' objects
  with a non-null tzinfo attribute

Returns
-------
checker : function
  decorator that makes sure that every argument of the decorated
  function that is in 'argnames' is given only 'datetime.datetime' objects
  with non-null tzinfo attribute as valuesc                 4   >^  [        T 5      UU 4S j5       nU$ )an  Decorator (see above in the `Returns` section)

Parameters
----------
func : function
  decorated function
  every argument of 'func' that is in argnames
  will only accept tz-aware 'datetime' objects

Returns
-------
func_with_check : function
  decorated function, basically the same function as 'func',
  with the check for tz-awareness performed before executionc                    > T H  n[         R                  " T5      nX#R                  ;   d  X#R                  ;   d  M9   XR                  R	                  U5         n[        US5      (       a  Mj  [        US5      (       d  [        SU< SU< S35      eUR                  b  M  [        X$5      e   T" U 0 UD6$ ! [
        [        4 a    X   n Nrf = f)a%  Decorated function ; will be, apart from the check,
completely identical to the 'func' function
We search for 'argnames' values in args and kwargs

Parameters
----------
args : list
  list of positional arguments that are supposedly
  passed to the 'func' function
kwargs : dict
  dict of keyword arguments that are supposedly passed
  to the 'func' function

Returns
-------
func(*args, **kwargs)
  we return the very same result that would have been returned
  by the 'func' function alone
  we just checked the values of args from argnames beforeshapetzinfoz3Expected a 'datetime.datetime' object     for arg 'z', got z instead)
inspectgetfullargspecr   
kwonlyargsindex
IndexError
ValueErrorhasattrr!   r   )r   kwargsr	   fullr
   argnamesfuncs        r   func_with_check8check_aware_dt.<locals>.checker.<locals>.func_with_check6   s    * '%%d+yy &!iioog./B W%%2x((%,b23 3 yy '44# $ 4"6"" j) !B!s   B77CCr   )r,   r-   r+   s   ` r   checkercheck_aware_dt.<locals>.checker'   s$     4[&# &#N r    )r+   r/   s   ` r   check_aware_dtr2      s    &7p 
.r   )	functoolsr   r"   r'   r   r2   r1   r   r   <module>r4      s     =* =Kr   