o
    .&ßa  ã                   @   s*   d Z ddlZddlZe e¡Zdd„ ZdS )aZ  
Add authored examples to MAN and HTML documentation
---------------------------------------------------

This customization allows authored examples in ReST format to be
inserted into the generated help for an Operation.  To get this to
work you need to:

* Register the ``add_examples`` function below with the
  ``doc-examples.*.*`` event.
* Create a file containing ReST format fragment with the examples.
  The file needs to be created in the ``examples/<service_name>``
  directory and needs to be named ``<service_name>-<op_name>.rst``.
  For example, ``examples/ec2/ec2-create-key-pair.rst``.

é    Nc              	   K   sš   t j t j t j t j t¡¡¡d¡}t j || j dt jj¡¡}|d }t	 
d|¡ t j |¡rI| jj d¡ t|ƒ}| ¡ D ]
}| j |¡ q@d S d S )NÚexamplesÚ.z.rstzLooking for example file at: %sÚExamples)ÚosÚpathÚjoinÚdirnameÚabspathÚ__file__Úevent_classÚreplaceÚsepÚLOGÚdebugÚisfileÚdocÚstyleÚh2ÚopenÚ	readlinesÚwrite)Úhelp_commandÚkwargsÚdoc_pathÚfpÚline© r   úC/usr/lib/python3/dist-packages/awscli/customizations/addexamples.pyÚadd_examples$   s(   
ÿÿýÿür   )Ú__doc__r   ÚloggingÚ	getLoggerÚ__name__r   r   r   r   r   r   Ú<module>   s
   
