File: //lib/python3.6/site-packages/awscli/customizations/__pycache__/addexamples.cpython-36.pyc
3
�T_ � @ s* d Z ddlZddlZeje�Zdd� ZdS )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 jjt jjt jjt jjt���d�}t jj|| jjdt jj��}|d }t j
d|� t jj|�r�| jj
jd� t|�}x|j� D ]}| jj|� q�W d S )NZexamples�.z.rstzLooking for example file at: %sZExamples)�os�path�join�dirname�abspath�__file__Zevent_class�replace�sep�LOG�debug�isfile�docZstyleZh2�open� readlines�write)Zhelp_command�kwargsZdoc_path�fp�line� r �!/usr/lib/python3.6/addexamples.py�add_examples$ s r )�__doc__r ZloggingZ getLogger�__name__r r r r r r �<module> s