î
2!ìV˜  ã               @   sš   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 Gd	 d
 „  d
 e ƒ Z d S)é    )Úimport_module)Úsix)Ú
LazyObject)Ú
ParserBase)Ú
LxmlParser)ÚDefaultHtmlParser)ÚBeautifulSoupParser)ÚHtml5LibParserc               @   sU   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  |  _  |  j | ƒ d  S)N)Ú_wrappedÚ_setup)ÚselfÚcontent© r   úG/tmp/pip-build-0sboevxh/django-compressor/compressor/parser/__init__.pyÚ__init__   s    	zAutoSelectParser.__init__c             C   s   t  |  j | ƒ S)N)Úgetattrr   )r   Únamer   r   r   Ú__getattr__   s    zAutoSelectParser.__getattr__c             C   sZ   xS |  j  D]H \ } } y t | ƒ | | ƒ |  _ PWq
 t t f k
 rQ w
 Yq
 Xq
 Wd  S)N)Ú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   Zdjango.utilsr   Zdjango.utils.functionalr   Zcompressor.parser.baser   Zcompressor.parser.lxmlr   Z$compressor.parser.default_htmlparserr   r   Zcompressor.parser.beautifulsoupr   Zcompressor.parser.html5libr	   r
   r   r   r   r   Ú<module>   s   