
    jg                     V    d dl mZ d dlZd dlZd dlZd dlmZ d ZddZ G d d      Z	y)	    )BytesION)settingsc                     ddl m} ddlm} 	  |       |    }t	        j
                  |      j                  }|S # |t        f$ r Y yw xY w)zp
    Load a templatetag library on multiple Django versions.

    Returns None if the library isn't loaded.
    r   )get_installed_libraries)InvalidTemplateLibraryN)django.template.backends.djangor   django.template.libraryr   	importlibimport_moduleregisterKeyError)libnamer   r   libs       S/var/www/html/Stanley/venv/lib/python3.12/site-packages/django_extensions/compat.pyload_tag_libraryr      sO     H>%'0%%c*33
"H- s   *9 AAc                 P    t        t        dd      }|r|D ]  }| |v s||    c S  |S )z Read template settings 	TEMPLATESN)getattrr   )template_keydefaulttemplates_vartdicts       r   get_template_settingr      s7    Hk48M"Eu$\** # N    c                   <    e Zd ZdZej
                  dfdZd Zd Zy)UnicodeWriterz
    CSV writer which will write rows to CSV file "f",
    which is encoded in the given encoding.
    We are using this custom UnicodeWriter for python versions 2.x
    utf-8c                     t               | _        t        j                  | j                  fd|i|| _        || _         t        j                  |             | _        y )Ndialect)r   queuecsvwriterstreamcodecsgetincrementalencoderencoder)selffr   encodingkwdss        r   __init__zUnicodeWriter.__init__/   sG    Y
jjEWEE=v33H=?r   c                 v   | j                   j                  |D cg c]  }|j                  d       c}       | j                  j	                         }|j                  d      }| j                  j                  |      }| j                  j                  |       | j                  j                  d       y c c}w )Nr   r   )
r"   writerowencoder    getvaluedecoder&   r#   writetruncate)r'   rowsdatas       r   r-   zUnicodeWriter.writerow5   s    =Aahhw/=>zz""${{7#||""4($

A >s   B6c                 4    |D ]  }| j                  |        y N)r-   )r'   rowsr3   s      r   	writerowszUnicodeWriter.writerowsA   s    CMM# r   N)	__name__
__module____qualname____doc__r!   excelr+   r-   r9    r   r   r   r   (   s"     #&))g @
r   r   r7   )
ior   r!   r$   r
   django.confr   r   r   r   r?   r   r   <module>rB      s(     
      r   