B 䊇c@@stddlmZddlmZddlmZddlmZGdddeZ Gddde Z Gd d d e Z Gd d d e Z d S))DocumentStructure)document_model_driven_method)document_paginate_method)document_wait_methodcsZeZdZdZfddZfddZddZdd d Zd d ZeZ d dZ ddZ Z S)LazyLoadedDocstringa0Used 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. cs t||_||_d|_dS)z The args and kwargs are the same as the underlying document generation function. These just get proxied to the underlying function. N)super__init__ _gen_args _gen_kwargs _docstring)selfargskwargs) __class__r/private/var/folders/8c/hx9_v10d5x38qmnzt13b7b8j1k3n5b/T/pip-target-x6xd5gna/lib/python/botocore/docs/docstring.pyrs zLazyLoadedDocstring.__init__cs t|S)N)r__new__)clsr r)rrrr'szLazyLoadedDocstring.__new__cOs tddS)Nzq_write_docstring is not implemented. Please subclass from this class and provide your own _write_docstring method)NotImplementedError)r r rrrr_write_docstring+sz$LazyLoadedDocstring._write_docstringcCs|jdkr||j|S)aExpands 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 tabsizerrrr1s zLazyLoadedDocstring.expandtabscCs|S)N)r)r rrr__str__?szLazyLoadedDocstring.__str__cCs|jdkr||_|jS)N)r _create_docstring)r rrrrEs  zLazyLoadedDocstring._generatecCs0tddd}|j|f|j|j|dS)NZ docstringhtml)targetzutf-8)rrr r Zflush_structuredecode)r Zdocstring_structurerrrrKs z%LazyLoadedDocstring._create_docstring)r) __name__ __module__ __qualname____doc__rrrrr__repr__rr __classcell__rr)rrrs  rc@seZdZddZdS)ClientMethodDocstringcOst||dS)N)r)r r rrrrrVsz&ClientMethodDocstring._write_docstringN)rr r!rrrrrr%Usr%c@seZdZddZdS)WaiterDocstringcOst||dS)N)r)r r rrrrr[sz WaiterDocstring._write_docstringN)rr r!rrrrrr&Zsr&c@seZdZddZdS)PaginatorDocstringcOst||dS)N)r)r r rrrrr`sz#PaginatorDocstring._write_docstringN)rr r!rrrrrr'_sr'N) Zbotocore.docs.bcdoc.restdocrZbotocore.docs.methodrZbotocore.docs.paginatorrZbotocore.docs.waiterrstrrr%r&r'rrrr s    B