o 3a @s\ddlmZddlmZddlmZGdddZGdddZeZej Z ej Z ej Z dS) )chain)func_accepts_kwargs) is_iterablec@sDeZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdS)Tagsz, Built-in tags for internal checks. admin async_supportcaches compatibilitydatabasemodelssecuritysignalssites staticfiles templates translationurlsN)__name__ __module__ __qualname____doc__rrrr r r r r rrrrrrr=/usr/lib/python3/dist-packages/django/core/checks/registry.pyrsrc@sFeZdZddZdddZdddZdd d Zdd d Zdd dZdS) CheckRegistrycCst|_t|_dSN)setregistered_checksdeployment_checks)selfrrr__init__s zCheckRegistry.__init__Ncs2fdd}t|r||S|r|f7|S)a Can be used as a function or a decorator. Register given function `f` labeled with given `tags`. The function should receive **kwargs and return list of Errors and Warnings. Example:: registry = CheckRegistry() @registry.register('mytag', 'anothertag') def my_check(app_configs, **kwargs): # ... perform checks and collect `errors` ... return errors # or registry.register(my_check, 'mytag', 'anothertag') cs:t|std|_drjnj}|||S)Nz9Check functions must accept keyword arguments (**kwargs).deploy)r TypeErrortagsgetrradd)checkcheckskwargsrr"rrinner0s z%CheckRegistry.register..inner)callable)rr%r"r(r)rr'rregister s   zCheckRegistry.registerFc s`g}||}durfdd|D}|D]}|||d}t|s(Jd|||q|S)zS Run all registered checks and return list of Errors and Warnings. Ncs g|] }t|js|qSr)rr" isdisjoint.0r%r"rr Is z,CheckRegistry.run_checks..) app_configs databaseszlThe function %r did not return a list. All functions registered with the checks registry must return a list.) get_checksrextend) rr1r"include_deployment_checksr2errorsr&r% new_errorsrr/r run_checksAs    zCheckRegistry.run_checkscCs|||vSr)tags_available)rtagr5rrr tag_existsSszCheckRegistry.tag_existscCsttdd||DS)Ncss|]}|jVqdSrr/r-rrr Ws z/CheckRegistry.tags_available..)rr from_iterabler3)rrrrrr9Vs  zCheckRegistry.tags_availablecCst|j}|r ||j|Sr)listrr4r)rr5r&rrrr3[s  zCheckRegistry.get_checksr)NNFN)F) rrrrr+r8r;r9r3rrrrrs  !  rN) itertoolsrdjango.utils.inspectrdjango.utils.itercompatrrrregistryr+r8r;rrrrs  H