
     hR                         d Z ddlmZmZ ddlmZ ddlmZ ddlm	Z	  G d de          Z
 G d d	e          Zd
 Zd ZdS )a]  Sphinx documentation plugin used to document tasks.

Introduction
============

Usage
-----

The Celery extension for Sphinx requires Sphinx 2.0 or later.

Add the extension to your :file:`docs/conf.py` configuration module:

.. code-block:: python

    extensions = (...,
                  'celery.contrib.sphinx')

If you'd like to change the prefix for tasks in reference documentation
then you can change the ``celery_task_prefix`` configuration value:

.. code-block:: python

    celery_task_prefix = '(task)'  # < default

With the extension installed `autodoc` will automatically find
task decorated objects (e.g. when using the automodule directive)
and generate the correct (as well as add a ``(task)`` prefix),
and you can also refer to the tasks using `:task:proj.tasks.add`
syntax.

Use ``.. autotask::`` to alternatively manually document a task.
    )formatargspecgetfullargspec)
PyFunction)FunctionDocumenter)BaseTaskc                   N     e Zd ZdZdZdZed             Zd Zd	dZ	 fdZ
 xZS )
TaskDocumenterzDocument task definitions.task   c                 L    t          |t                    ot          |d          S )N__wrapped__
isinstancer   getattr)clsmember
membernameisattrparents        Q/var/www/html/Sam_Eipo/venv/lib/python3.11/site-packages/celery/contrib/sphinx.pycan_document_memberz"TaskDocumenter.can_document_member/   s!    &(++N0N0NN    c                     t          | j        dd           }|Qt          |          }|d         r|d         d         dv r	|d         d= t          | }|                    dd          }|S dS )Nr   r   )r   self\z\\ )r   objectr   r   replace)r   wrappedargspecfmts       r   format_argszTaskDocumenter.format_args3   sx    $+}d;;$W--Gqz "gajm>>AJqM)C++dF++CJrr   Fc                     d S N )r   all_memberss     r   document_memberszTaskDocumenter.document_members>   s    r   c                     t          | j        dd           }|rt          |d          | j        k    rdS t                                                      S )Nr   
__module__T)r   r   modnamesupercheck_module)r   r   	__class__s     r   r,   zTaskDocumenter.check_moduleA   sQ    
 $+}d;; 	ww55EE4ww##%%%r   )F)__name__r)   __qualname____doc__objtypemember_orderclassmethodr   r"   r'   r,   __classcell__)r-   s   @r   r	   r	   )   s        $$GLO O [O	 	 	   & & & & & & & & &r   r	   c                       e Zd ZdZd ZdS )TaskDirectivezSphinx task directive.c                 $    | j         j        j        S r$   )envconfigcelery_task_prefix)r   sigs     r   get_signature_prefixz"TaskDirective.get_signature_prefixO   s    x11r   N)r.   r)   r/   r0   r<   r%   r   r   r6   r6   L   s)          2 2 2 2 2r   r6   c                 X    t          |t                    rt          |d          r|rdS dS )z&Handler for autodoc-skip-member event.r   FNr   )appwhatnameobjskipoptionss         r   autodoc_skip_member_handlerrD   S   s9     #x   WS-%@%@  	54r   c                    |                      d           |                     t                     |                     ddt                     |                     ddd           |                     dt                     ddiS )	zSetup Sphinx extension.zsphinx.ext.autodocpyr
   r:   z(task)Tzautodoc-skip-memberparallel_read_safe)setup_extensionadd_autodocumenterr	   add_directive_to_domainr6   add_config_valueconnectrD   )r>   s    r   setuprM   `   s    ,--->***fm<<<-x>>>KK%'BCCC 	d r   N)r0   inspectr   r   sphinx.domains.pythonr   sphinx.ext.autodocr   celery.app.taskr   r	   r6   rD   rM   r%   r   r   <module>rR      s    @ 2 1 1 1 1 1 1 1 , , , , , , 1 1 1 1 1 1 $ $ $ $ $ $ &  &  &  &  &'  &  &  &F2 2 2 2 2J 2 2 2
 
 

 
 
 
 
r   