
    Kwg                     l    d Z dZddlmZ  G d d      Z e       Z G d d      Z e       Z ed      Zy	)
z3.3.0zALogging and warning framework, predating Python's logging package    )stderrc                   .    e Zd ZdZd Zd Zd Zd Zd Zy)Loggerz
    An extended file type thing initially equivalent to sys.stderr
    You can add/remove file type things; it has a write method
    c                 *    t         g| _        i | _        y N)r   _fps_fns)selfs    K/var/www/horilla/myenv/lib/python3.12/site-packages/reportlab/lib/logger.py__init__zLogger.__init__   s    H		    c                     t        |t              r2|| j                  v ryt        t        d      }|| j                  t        <   | j
                  j                  |       y)z*add the file/string fp to the destinationsNwb)
isinstancestrr	   openfnr   append)r
   fps     r   addz
Logger.add   sC    bTYYbBDIIbM		r   c                     t        |t              r-|| j                  vry|}| j                  |   }| j                  |= || j                  v r'| j                  | j                  j                  |      = yy)z/remove the file/string fp from the destinationsN)r   r   r	   fnsr   index)r
   r   r   s      r   removezLogger.remove   s`    b"FB2B?		$))//"-. r   c                 b    |d   dk7  r|dz   }| j                   D ]  }|j                  |        y)z"write text to all the destinations
N)r   write)r
   textr   s      r   r   zLogger.write#   s.    8T>T	4))+BRXXd^+r   c                 &    | j                  |       y r   )r   )r
   r   s     r   __call__zLogger.__call__(   s    

4r   N)	__name__
__module____qualname____doc__r   r   r   r   r!    r   r   r   r      s     /,
r   r   c                        e Zd ZddZd Zd Zy)WarnOncec                 4    i | _         d|z  | _        d| _        y )Nz%s:    )utteredpfxenabled)r
   kinds     r   r   zWarnOnce.__init__/   s    $;r   c                     || j                   vr>| j                  r"t        j                  | j                  |z          d| j                   |<   y y )Nr*   )r+   r-   loggerr   r,   r
   warnings     r   oncezWarnOnce.once4   s<    $,,&||V\\$((W*<=$%DLL! 'r   c                 &    | j                  |       y r   )r3   r1   s     r   r!   zWarnOnce.__call__9   s    		'r   N)Warn)r"   r#   r$   r   r3   r!   r&   r   r   r(   r(   -   s    
&
r   r(   InfoN)	__version__r%   sysr   r   r0   r(   warnOnceinfoOncer&   r   r   <module>r;      sE   
 K ! !F x  
	&	r   