§
    cÌcË  ã                   óv   — d Z ddlZddlZddlZddlZddlZddlZd„ Zd„ Zd„ Z		 	 dd„Z
	 	 dd
„Zd„ ZdZdZdZdS )z Generate reStructuredText source for the User Reference Manual.
Loosely based on the manpage generator autodoc_man.py.

Written by the Bazaar/Breezy community.
é    Nc                 ó   — d| j         z  S )zProvides name of manualz
%s_man.txt)Úbrz_name)Úoptionss    úB/usr/lib/python3/dist-packages/breezy/doc_generate/autodoc_rstx.pyÚget_filenamer       s   € à˜7Ô+Ñ,Ð,ó    c                 ó*  — t          j         ¦   «         }t          j        |¦  «        }| j        t          j        d|¦  «        t          j        d|¦  «        t          j        dœ}t          | dd¦  «        }|€d}nt          j                             |¦  «        }| 	                    t          |z  ¦  «         | 	                    t          |z  ¦  «         | 	                    t          ||¦  «        ¦  «         | 	                    t          |z  ¦  «         dS )zCreate manual in RSTX formatz%Y-%m-%dz%Y-%m-%d %H:%M:%S +0000)ÚbrzcmdÚ	datestampÚ	timestampÚversionÚfilenameN)ÚtimeÚgmtimer   ÚstrftimeÚbreezyÚ__version__ÚgetattrÚosutilsÚdirnameÚwriteÚrstx_preambleÚ	rstx_headÚ	_get_bodyÚ	rstx_foot)r   ÚoutfileÚtÚttÚparamsÚnominated_filenameÚ	topic_dirs          r   Úinfogenr"   %   sò   € åŒ	‰Œ€AÝ	Œ�Q‰Œ€BàÔ#Ý”m J°Ñ3Ô3Ý”mÐ$=¸rÑBÔBÝÔ&ð	ð 	ð õ ! ¨*°dÑ;Ô;ÐØÐ!Øˆ	ˆ	å”N×*Ò*Ð+=Ñ>Ô>ˆ	Ø‡M‚M•- &Ñ(Ñ)Ô)Ð)Ø‡M‚M•)˜fÑ$Ñ%Ô%Ð%Ø‡M‚M•)˜F IÑ.Ô.Ñ/Ô/Ð/Ø‡M‚M•)˜fÑ$Ñ%Ô%Ð%Ð%Ð%r   c                 óF  — ddl m}m}m} t          j        j        }g }|                     t          ||d|¬¦  «        ¦  «         |                     t          ||d|¬¦  «        ¦  «         |                     t          ||¬¦  «        ¦  «         d 
                    |¦  «        S )zBuild the manual content.r   )ÚSECT_CONCEPTÚ	SECT_LISTÚSECT_PLUGINÚConcepts)Ú
output_dirÚListsú
)Úbreezy.help_topicsr$   r%   r&   r   Úhelp_topicsÚtopic_registryÚappendÚ_get_sectionÚ_get_commands_sectionÚjoin)r   r!   r$   r%   r&   ÚregistryÚresults          r   r   r   :   sÂ   € àGÐGÐGÐGÐGÐGÐGÐGÐGÐGÝÔ!Ô0€HØ€FØ
‡M‚M•,˜x¨°zØ*3ð5ñ 5ô 5ñ 6ô 6ð 6à
‡M‚M•,˜x¨°GØ*3ð5ñ 5ô 5ñ 6ô 6ð 6à
‡M‚MÕ'¨¸YÐGÑGÔGÑHÔHÐHØ�9Š9�VÑÔÐr   ú#ú=c                 ór  — |du}||t          |¦  «        z  dg}|r|                     g d¢¦  «         t          |                      |¦  «        ¦  «        }|D ]Æ}	|                      |	¦  «        }
|
                     dd¦  «        \  }}|                     |¦  «        s*|t          |¦  «        z  }d                     |||¦  «        }
nd                     ||¦  «        }
|r*t          ||	|
¦  «        }| 	                    d|z  ¦  «         Œ±| 	                    |
¦  «         ŒÇdd 
                    |¦  «        z   dz   S )	zÌBuild the manual part from topics matching that section.

    If output_dir is not None, topics are dumped into text files there
    during processing, as well as being included in the return result.
    NÚ ©z.. toctree::z   :maxdepth: 1r7   r*   é   ú{}
{}

{}

z{}
{}

ú   %s)ÚlenÚextendÚsortedÚget_topics_for_sectionÚ
get_detailÚsplitÚ
startswithÚformatÚ
_dump_textr.   r1   )r2   ÚsectionÚtitleÚ
hdg_level1Ú
hdg_level2r(   Úfile_per_topicÚlinesÚtopicsÚtopicÚhelpÚheadingÚtextÚ	underlineÚtopic_ids                  r   r/   r/   G   sP  € ð   tÐ+€NØ�J¥ U¡¤Ñ+¨RÐ0€EØð >Ø�ŠÐ<Ð<Ð<Ñ=Ô=Ð=å�H×3Ò3°GÑ<Ô<Ñ=Ô=€FØð ð ˆØ×"Ò" 5Ñ)Ô)ˆØŸ
š
 4¨Ñ+Ô+‰ˆ�Ø�Š˜zÑ*Ô*ð 	6Ø"¥S¨¡\¤\Ñ1ˆIØ%×,Ò,¨W°iÀÑFÔFˆDˆDà×&Ò& w°Ñ5Ô5ˆDØð 	Ý! *¨e°TÑ:Ô:ˆHØ�LŠL˜ 8Ñ+Ñ,Ô,Ð,Ð,à�LŠL˜ÑÔÐÐà�$—)’)˜EÑ"Ô"Ñ" TÑ)Ð)r   ÚCommandsc                 óP  — |du}||t          |¦  «        z  dg}|r|                     g d¢¦  «         t          t          j                             ¦   «         ¦  «        }|D ]¬}t          j                             |¦  «        }	|	j        rŒ)|}
|t          |
¦  «        z  }|	                     dd¬¦  «        }d 	                    |
||¦  «        }|r*t          |||¦  «        }|                     d|z  ¦  «         Œ—|                     |¦  «         Œ­d	d	                     |¦  «        z   d	z   S )
z3Build the commands reference section of the manual.Nr7   r8   FT)ÚplainÚsee_also_as_linksr:   r;   r*   )r<   r=   r>   r   ÚcommandsÚbuiltin_command_namesÚget_cmd_objectÚhiddenÚget_help_textrC   rD   r.   r1   )r2   rF   rG   rH   r(   rI   rJ   ÚcmdsÚcmd_nameÚ
cmd_objectrN   rP   rO   rM   rQ   s                  r   r0   r0   e   s;  € ð   tÐ+€NØ�J¥ U¡¤Ñ+¨RÐ0€EØð >Ø�ŠÐ<Ð<Ð<Ñ=Ô=Ð=å•&”/×7Ò7Ñ9Ô9Ñ:Ô:€DØð ð ˆÝ”_×3Ò3°HÑ=Ô=ˆ
ØÔð 	ØØˆØ¥ W¡¤Ñ-ˆ	Ø×'Ò'¨eÀtÐ'ÑLÔLˆØ!×(Ò(¨°)¸TÑBÔBˆØð 	Ý! *¨h¸Ñ=Ô=ˆHØ�LŠL˜ 8Ñ+Ñ,Ô,Ð,Ð,à�LŠL˜ÑÔÐÐà�$—)’)˜EÑ"Ô"Ñ" TÑ)Ð)r   c                 ó  — d                      |d¦  «        }t          j                             | |dz   ¦  «        }t	          |d¦  «        5 }|                     |                     d¦  «        ¦  «         ddd¦  «         n# 1 swxY w Y   |S )z Dump text for a topic to a file.z{}-{}rM   z.txtÚwbzutf-8N)rC   r   r   ÚpathjoinÚopenr   Úencode)r(   rL   rO   rQ   r   Úfs         r   rD   rD      s¶   € à�~Š~˜e VÑ,Ô,€HÝŒ~×&Ò& z°8¸fÑ3DÑEÔE€HÝ	ˆh˜Ñ	Ô	ð & Ø	�Š�—’˜GÑ$Ô$Ñ%Ô%Ð%ð&ð &ð &ñ &ô &ð &ð &ð &ð &ð &ð &øøøð &ð &ð &ð &à€Os   Á
)A?Á?BÂBz�.. This file is autogenerated from the output of
..     %(brzcmd)s help topics
..     %(brzcmd)s help commands
..     %(brzcmd)s help <cmd>
..

a  #####################
Breezy User Reference
#####################

About This Manual
#################

This manual is generated from Breezy's online help. To use
the online help system, try the following commands.

    Introduction including a list of commonly used commands::

        brz help

    List of topics and a summary of each::

        brz help topics

    List of commands and a summary of each::

        brz help commands

    More information about a particular topic or command::

        brz help topic-or-command-name

The following web sites provide further information on Breezy:

:Home page:                     http://www.breezy-vcs.org/
:Breezy docs:                   http://www.breezy-vcs.org/doc/
:Launchpad:                     https://launchpad.net/brz/
r*   )r4   r5   N)rR   r4   r5   N)Ú__doc__r   r   Úbreezy.helpr+   Úbreezy.commandsÚbreezy.osutilsr   r"   r   r/   r0   rD   r   r   r   © r   r   ú<module>ri      så   ðð"ð ð €€€à €€€Ø Ð Ð Ð Ø Ð Ð Ð Ø Ð Ð Ð Ø Ð Ð Ð ð-ð -ð -ð
&ð &ð &ð*
ð 
ð 
ð GJØ ð*ð *ð *ð *ð< BEØ59ð*ð *ð *ð *ð4ð ð ð€ð €	ðF€	€	€	r   