ó
®â0_c           @  sp   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	 m
 Z
 d e	 f d „  ƒ  YZ d S(	   iÿÿÿÿ(   t   unicode_literals(   t   apps(   t   checks(   t   registry(   t   BaseCommandt   CommandErrort   Commandc           B  s&   e  Z d  Z e Z d „  Z d „  Z RS(   u8   Checks the entire Django project for potential problems.c      
   C  s±   | j  d d d d d ƒ| j  d d d d	 d
 d d d ƒ| j  d d d d
 d d d ƒ| j  d d d d
 d d d ƒ| j  d d d d d d d d d g d
 d d d ƒd  S(   Nu   argst   metavaru	   app_labelt   nargsu   *u   --tagu   -tt   actionu   appendt   destu   tagst   helpu'   Run only checks labeled with given tag.u   --list-tagsu
   store_trueu	   list_tagsu   List available tags.u   --deployu   deployu   Check deployment settings.u   --fail-levelt   defaultu   ERRORt   choicesu   CRITICALu   WARNINGu   INFOu   DEBUGu
   fail_levelu[   Message level that will cause the command to exit with a non-zero status. Default is ERROR.(   t   add_argument(   t   selft   parser(    (    sG   /tmp/pip-unpacked-wheel-BAJOf3/django/core/management/commands/check.pyt   add_arguments   s     c           s  | d ‰  | d r@ |  j  j d j t t j ˆ  ƒ ƒ ƒ ƒ d  S| rk g  | D] } t j | ƒ ^ qM } n d  } | d } | rÈ y  t	 ‡  f d †  | Dƒ ƒ } Wn t
 k
 r´ qÈ Xt d | ƒ ‚ n  |  j d | d | d	 t d
 ˆ  d t t | d ƒ ƒ d  S(   Nu   deployu	   list_tagsu   
u   tagsc         3  s'   |  ] } t  j | ˆ  ƒ s | Vq d  S(   N(   R   t
   tag_exists(   t   .0t   tag(   t   include_deployment_checks(    sG   /tmp/pip-unpacked-wheel-BAJOf3/django/core/management/commands/check.pys	   <genexpr>7   s    u+   There is no system check with the "%s" tag.t   app_configst   tagst   display_num_errorsR   t
   fail_levelu
   fail_level(   t   stdoutt   writet   joint   sortedR   t   tags_availableR   t   get_app_configt   Nonet   nextt   StopIterationR   t   checkt   Truet   getattrR   (   R   t
   app_labelst   optionst	   app_labelR   R   t   invalid_tag(    (   R   sG   /tmp/pip-unpacked-wheel-BAJOf3/django/core/management/commands/check.pyt   handle(   s*    

(%
	(   t   __name__t
   __module__R   t   Falset   requires_system_checksR   R*   (    (    (    sG   /tmp/pip-unpacked-wheel-BAJOf3/django/core/management/commands/check.pyR   
   s   	N(   t
   __future__R    t   django.appsR   t   django.coreR   t   django.core.checks.registryR   t   django.core.management.baseR   R   R   (    (    (    sG   /tmp/pip-unpacked-wheel-BAJOf3/django/core/management/commands/check.pyt   <module>   s
   