o
    ~¨Êh˜  ã                   @   st   d dl mZ d dlmZ d dlmZ d dlmZ d dlm	Z	 d dl
mZ d dlmZ d dlmZ G d	d
„ d
eƒZdS )é    )Úimport_module)Úsix)Ú
LazyObject)Ú
ParserBase)Ú
LxmlParser)ÚDefaultHtmlParser)ÚBeautifulSoupParser)ÚHtml5LibParserc                   @   s:   e Zd Zejjj efdeffZdd„ Z	dd„ Z
dd„ ZdS )	ÚAutoSelectParserz	lxml.htmlc                 C   s   d | _ |  |¡ d S ©N)Ú_wrappedÚ_setup)ÚselfÚcontent© r   úL/var/www/html/env/lib/python3.10/site-packages/compressor/parser/__init__.pyÚ__init__   s   zAutoSelectParser.__init__c                 C   s   t | j|ƒS r   )Úgetattrr   )r   Únamer   r   r   Ú__getattr__   s   zAutoSelectParser.__getattr__c              
   C   sD   | j D ]\}}zt|ƒ ||ƒ| _W  d S  ttfy   Y qw d S r   )Úoptionsr   r   ÚImportErrorÚ	TypeError)r   r   Ú
dependencyÚparserr   r   r   r      s   
ÿûzAutoSelectParser._setupN)Ú__name__Ú
__module__Ú__qualname__r   ÚmovesÚhtml_parserÚ
HtmlParserr   r   r   r   r   r   r   r   r   r
      s    ýr
   N)Ú	importlibr   Údjango.utilsr   Údjango.utils.functionalr   Úcompressor.parser.baser   Úcompressor.parser.lxmlr   Ú$compressor.parser.default_htmlparserr   r    Úcompressor.parser.beautifulsoupr   Úcompressor.parser.html5libr	   r
   r   r   r   r   Ú<module>   s    