HEX
Server: Apache
System: Linux infong-uk86 4.4.400-icpu-106 #2 SMP Mon Sep 15 08:23:40 UTC 2025 x86_64
User: u44115835 (4976590)
PHP: 8.4.17
Disabled: NONE
Upload Files
File: //kunden/lib/python3/dist-packages/breezy/__pycache__/help.cpython-39.pyc
a

�*�^U�@s�ddlmZddlmZmZmZmZmZm	Z	m
Z
Gdd�dej�Zddd�Z
dd	d
�Zdd�Zej�d
edej�ej�dedej�Gdd�de�ZdS)�)�absolute_import�)�commands�errors�help_topics�osutils�plugin�ui�	utextwrapc@seZdZdZdd�ZdS)�NoHelpTopicz`No help could be found for '%(topic)s'. Please use 'brz help topics' to obtain a list of topics.cCs
||_dS�N)�topic)�selfr
�r�-/usr/lib/python3/dist-packages/breezy/help.py�__init__*szNoHelpTopic.__init__N)�__name__�
__module__�__qualname__Z_fmtrrrrrr%srNc	Cs�|durtj��}t�}t�|�}z\|�|�}g}|dd�D] \}}|�d|j|�	�f�q>|dd}|�
|�|��Wnty�|dur��Yn0|dur�|�
d|d�
|�f�dS)z0Write the help for the specific topic to outfileNrz%s%srz#'brz %s' is an alias for 'brz %s'.
� )r	�
ui_factory�make_output_stream�HelpIndices�
_mod_commandsZ	get_alias�search�append�prefixZget_help_topic�writeZ
get_help_textr�join)	r
�outfile�indices�aliasZtopicsZshadowed_terms�indexZ	topic_obj�sourcerrr�help.s(



�
�r$cCs$|durtj��}|�td��dS)zList all commandsNr)r	rrr�_help_commands_to_text)rrrr�
help_commandsGs
r&csg}|dkrd�nd�tt���}dd�|D�}�fdd�|D�}tdd�|D��}d	|d
}t��}|durvtj}|d
}t|�D]�\}}	|	��}
|
dur�d}
nd
|
}
|	�	�}|r�|�
dd
�d}nd}d||||
f}
tj|
||dd�}|D]}|�
|d�q�q�d�|�S)z/Generate the help text for the list of commands�hidden-commandsTFcss|]}|t�|�fVqdSr)rZget_cmd_object)�.0�nrrr�	<genexpr>V�z)_help_commands_to_text.<locals>.<genexpr>cs"g|]\}}|j�kr||f�qSr�Zhidden�r(r)�or,rr�
<listcomp>Wr+z*_help_commands_to_text.<locals>.<listcomp>css|]\}}t|�VqdSr)�lenr-rrrr*Xr+rrN�z [%s]�
rz	%-*s %s%s)Zsubsequent_indent�widthZbreak_long_words)�listrZall_command_names�maxrZterminal_widthZdefault_terminal_width�sorted�plugin_namer$�splitr
Zwraprr)r
�out�namesrZshown_commandsZmax_name�indentr3Zcmd_nameZ
cmd_objectr7Zcmd_help�	firstlineZ
helpstring�lines�linerr,rr%Ns>�r%rzBasic help for all commandsr'zAll hidden commandsc@s(eZdZdZdd�Zdd�Zdd�ZdS)	ra�Maintainer of help topics across multiple indices.

    It is currently separate to the HelpTopicRegistry because of its ordered
    nature, but possibly we should instead structure it as a search within the
    registry and add ordering and searching facilities to the registry. The
    registry would probably need to be restructured to support that cleanly
    which is why this has been implemented in parallel even though it does as a
    result permit searching for help in indices which are not discoverable via
    'help topics'.

    Each index has a unique prefix string, such as "commands", and contains
    help topics which can be listed or searched.
    cCs"t��t��t��t��g|_dSr)rZHelpTopicIndexrZHelpCommandIndexrZPluginsHelpIndexZConfigOptionHelpIndex�search_path)rrrrr�s
�zHelpIndices.__init__cCs8t�}|jD]&}|j}||vr(t�|��|�|�qdS)zAEnsure that the index collection is able to differentiate safely.N)�setr?rrZDuplicateHelpPrefix�add)r�prefixesr"rrrr�_check_prefix_uniqueness�s

z$HelpIndices._check_prefix_uniquenesscsL|��g}|jD]"�|��fdd���|�D��q|sDt|��n|SdS)aSearch for topic across the help search path.

        :param topic: A string naming the help topic to search for.
        :raises: NoHelpTopic if none of the indexs in search_path have topic.
        :return: A list of HelpTopics which matched 'topic'.
        csg|]}�|f�qSrr)r(Z_topic�r"rrr/�s�z&HelpIndices.search.<locals>.<listcomp>N)rCr?�extendZ
get_topicsr)rr
�resultrrDrr�s
�

zHelpIndices.searchN)rrr�__doc__rrCrrrrrr�s	r)NN)N)Z
__future__rr1rrrrrrr	r
ZBzrErrorrr$r&r%Ztopic_registry�registerZSECT_HIDDEN�objectrrrrr�<module>s 	$	

(��