o
    .&ßas  ã                   @   st   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	G dd„ de	ƒZ
G d	d
„ d
e	ƒZG dd„ de	ƒZdS )é    ©Údocument_model_driven_method©Údocument_wait_method©Údocument_paginate_method)ÚDocumentStructurec                       sZ   e Zd ZdZ‡ fdd„Z‡ fdd„Zdd„ Zdd	d
„Zdd„ ZeZ	dd„ Z
dd„ Z‡  ZS )ÚLazyLoadedDocstringa0  Used for lazily loading docstrings

    You can instantiate this class and assign it to a __doc__ value.
    The docstring will not be generated till accessed via __doc__ or
    help(). Note that all docstring classes **must** subclass from
    this class. It cannot be used directly as a docstring.
    c                    s$   t t| ƒ ¡  || _|| _d| _dS )z¥
        The args and kwargs are the same as the underlying document
        generation function. These just get proxied to the underlying
        function.
        N)Úsuperr	   Ú__init__Ú	_gen_argsÚ_gen_kwargsÚ
_docstring©ÚselfÚargsÚkwargs©Ú	__class__© ú9/usr/lib/python3/dist-packages/botocore/docs/docstring.pyr      s   
zLazyLoadedDocstring.__init__c                    s   t t| ƒ | ¡S ©N)r
   r	   Ú__new__)Úclsr   r   r   r   r   r   &   s   zLazyLoadedDocstring.__new__c                 O   s   t dƒ‚)Nzq_write_docstring is not implemented. Please subclass from this class and provide your own _write_docstring method)ÚNotImplementedErrorr   r   r   r   Ú_write_docstring*   s   ÿz$LazyLoadedDocstring._write_docstringé   c                 C   s   | j du r	|  ¡  | j  |¡S )a™  Expands tabs to spaces

        So this is a big hack in order to get lazy loaded docstring work
        for the ``help()``. In the ``help()`` function, ``pydoc`` and
        ``inspect`` are used. At some point the ``inspect.cleandoc``
        method is called. To clean the docs ``expandtabs`` is called
        and that is where we override the method to generate and return the
        docstrings.
        N)r   Ú	_generateÚ
expandtabs)r   Útabsizer   r   r   r   0   s   

zLazyLoadedDocstring.expandtabsc                 C   s   |   ¡ S r   )r   ©r   r   r   r   Ú__str__>   s   zLazyLoadedDocstring.__str__c                 C   s   | j d u r
|  ¡ | _ | j S r   )r   Ú_create_docstringr    r   r   r   r   D   s   

zLazyLoadedDocstring._generatec                 C   s6   t ddd�}| j|g| j¢R i | j¤Ž | ¡  d¡S )NÚ	docstringÚhtml)Útargetzutf-8)r   r   r   r   Úflush_structureÚdecode)r   Údocstring_structurer   r   r   r"   J   s   ÿÿþz%LazyLoadedDocstring._create_docstring)r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r!   Ú__repr__r   r"   Ú__classcell__r   r   r   r   r	      s    
r	   c                   @   ó   e Zd Zdd„ ZdS )ÚClientMethodDocstringc                 O   ó   t |i |¤Ž d S r   r   r   r   r   r   r   U   ó   z&ClientMethodDocstring._write_docstringN©r)   r*   r+   r   r   r   r   r   r0   T   ó    r0   c                   @   r/   )ÚWaiterDocstringc                 O   r1   r   r   r   r   r   r   r   Z   r2   z WaiterDocstring._write_docstringNr3   r   r   r   r   r5   Y   r4   r5   c                   @   r/   )ÚPaginatorDocstringc                 O   r1   r   r   r   r   r   r   r   _   r2   z#PaginatorDocstring._write_docstringNr3   r   r   r   r   r6   ^   r4   r6   N)Úbotocore.docs.methodr   Úbotocore.docs.waiterr   Úbotocore.docs.paginatorr   Úbotocore.docs.bcdoc.restdocr   Ústrr	   r0   r5   r6   r   r   r   r   Ú<module>   s   A