§
    cÌc-  ã                   ó  — d dl mZmZmZmZmZmZmZ  G d„ dej	        ¦  «        Z
dd„Zdd„Zd„ Zej                             ded	ej        ¦  «         ej                             d
edej        ¦  «          G d„ d¦  «        ZdS )é   )ÚcommandsÚerrorsÚhelp_topicsÚosutilsÚpluginÚuiÚ	utextwrapc                   ó   — e Zd ZdZd„ ZdS )ÚNoHelpTopicz`No help could be found for '%(topic)s'. Please use 'brz help topics' to obtain a list of topics.c                 ó   — || _         d S ©N)Útopic)Úselfr   s     ú-/usr/lib/python3/dist-packages/breezy/help.pyÚ__init__zNoHelpTopic.__init__(   s   € ØˆŒ
ˆ
ˆ
ó    N)Ú__name__Ú
__module__Ú__qualname__Ú_fmtr   © r   r   r   r   #   s+   € € € € € ðG€Dðð ð ð ð r   r   Nc                 ón  — |€t           j                             ¦   «         }t          ¦   «         }t	          j        | ¦  «        }	 |                     | ¦  «        }g }|dd…         D ]E\  }}|                     d                     |j	        | 
                    ¦   «         ¦  «        ¦  «         ŒF|d         d         }|                     |                     |¦  «        ¦  «         n# t          $ r |€‚ Y nw xY w|�>|                     d                     | d                     |¦  «        ¦  «        ¦  «         dS dS )z0Write the help for the specific topic to outfileNr   z{}{}é    z#'brz {}' is an alias for 'brz {}'.
ú )r   Ú
ui_factoryÚmake_output_streamÚHelpIndicesÚ_mod_commandsÚ	get_aliasÚsearchÚappendÚformatÚprefixÚget_help_topicÚwriteÚget_help_textr   Újoin)	r   ÚoutfileÚindicesÚaliasÚtopicsÚshadowed_termsÚindexÚ	topic_objÚsources	            r   Úhelpr0   ,   se  € à€Ý”-×2Ò2Ñ4Ô4ˆå‰mŒm€GåÔ# EÑ*Ô*€Eð
Ø—’ Ñ&Ô&ˆØˆØ & q r r¤
ð 	Ið 	IÑˆE�9Ø×!Ò! &§-¢-°´Ø,5×,DÒ,DÑ,FÔ,Fñ#Hô #Hñ Iô Ið Ið Ià˜”˜1”ˆØ�Š�f×*Ò*¨>Ñ:Ô:Ñ;Ô;Ð;Ð;øÝð ð ð Øˆ=Øð ˆ=ðøøøð ÐØ�ŠÐ<×CÒCÀEØ@CÇÂÈÁÄñQô Qñ 	Rô 	Rð 	Rð 	Rð 	Rð Ðs   ÁBC" Ã"C2Ã1C2c                 óŠ   — | €t           j                             ¦   «         } |                      t	          d¦  «        ¦  «         dS )zList all commandsNr   )r   r   r   r%   Ú_help_commands_to_text)r(   s    r   Úhelp_commandsr3   E   s;   € à€Ý”-×2Ò2Ñ4Ô4ˆØ‡M‚MÕ(¨Ñ4Ô4Ñ5Ô5Ð5Ð5Ð5r   c                 ó–  ‡— g }| dk    rdŠndŠt          t          j        ¦   «         ¦  «        }d„ |D ¦   «         }ˆfd„|D ¦   «         }t          d„ |D ¦   «         ¦  «        }d|dz   z  }t	          j        ¦   «         }|€t          j        }|dz
  }t          |¦  «        D ]–\  }}	|	                     ¦   «         }
|
€d
}
nd|
z  }
|	 	                    ¦   «         }|r| 
                    dd¦  «        d         }nd
}d||||
fz  }t          j        |||d¬¦  «        }|D ]}|                     |dz   ¦  «         ŒŒ—d
                     |¦  «        S )z/Generate the help text for the list of commandsúhidden-commandsTFc              3   óB   K  — | ]}|t          j        |¦  «        fV — Œd S r   )r   Úget_cmd_object)Ú.0Úns     r   ú	<genexpr>z)_help_commands_to_text.<locals>.<genexpr>T   s2   è è € ÐDÐD¸�•MÔ0°Ñ3Ô3Ð4ÐDÐDÐDÐDÐDÐDr   c                 ó4   •— g | ]\  }}|j         ‰k    ¯||f‘ŒS r   )Úhidden)r8   r9   Úor<   s      €r   ú
<listcomp>z*_help_commands_to_text.<locals>.<listcomp>U   s-   ø€ ÐHÐHÐH¡  A°Q´XÀÒ5GÐ5G�q˜!�fÐ5GÐ5GÐ5Gr   c              3   ó:   K  — | ]\  }}t          |¦  «        V — Œd S r   )Úlen)r8   r9   r=   s      r   r:   z)_help_commands_to_text.<locals>.<genexpr>V   s,   è è € Ð5Ð5™d˜a •3�q‘6”6Ð5Ð5Ð5Ð5Ð5Ð5r   r   r   NÚ z [%s]ú
r   z	%-*s %s%s)Úsubsequent_indentÚwidthÚbreak_long_words)Úlistr   Úall_command_namesÚmaxr   Úterminal_widthÚdefault_terminal_widthÚsortedÚplugin_namer0   Úsplitr	   Úwrapr!   r'   )r   ÚoutÚnamesr   Úshown_commandsÚmax_nameÚindentrD   Úcmd_nameÚ
cmd_objectrL   Úcmd_helpÚ	firstlineÚ
helpstringÚlinesÚliner<   s                   @r   r2   r2   L   s�  ø€ à
€CØÐ!Ò!Ð!ØˆˆàˆÝ•Ô0Ñ2Ô2Ñ3Ô3€EØDÐD¸eÐDÑDÔD€HØHÐHÐHÐH¨ÐHÑHÔH€NÝÐ5Ð5 nÐ5Ñ5Ô5Ñ5Ô5€HØ�H˜q‘LÑ!€FÝÔ"Ñ$Ô$€EØ€}ÝÔ.ˆà�A‰I€Eå & ~Ñ 6Ô 6ð $ð $Ñˆ�*Ø ×,Ò,Ñ.Ô.ˆØÐØˆKˆKà! KÑ/ˆKà—?’?Ñ$Ô$ˆØð 	Ø Ÿš t¨QÑ/Ô/°Ô2ˆIˆIàˆIØ  H¨h¸	À;Ð#OÑOˆ
Ý”Ø¨&ØØ"ð$ñ $ô $ˆð ð 	$ð 	$ˆDØ�JŠJ�t˜d‘{Ñ#Ô#Ð#Ð#ð	$à�7Š7�3‰<Œ<Ðr   r   zBasic help for all commandsr5   zAll hidden commandsc                   ó$   — e Zd ZdZd„ Zd„ Zd„ ZdS )r   aœ  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.
    c                 ó¤   — t          j        ¦   «         t          j        ¦   «         t	          j        ¦   «         t          j        ¦   «         g| _        d S r   )r   ÚHelpTopicIndexr   ÚHelpCommandIndexr   ÚPluginsHelpIndexÚConfigOptionHelpIndexÚsearch_path)r   s    r   r   zHelpIndices.__init__�   sB   € åÔ&Ñ(Ô(ÝÔ*Ñ,Ô,ÝÔ#Ñ%Ô%ÝÔ-Ñ/Ô/ð	ˆÔÐÐr   c                 óž   — t          ¦   «         }| j        D ]6}|j        }||v rt          j        |¦  «        ‚|                     |¦  «         Œ7dS )zAEnsure that the index collection is able to differentiate safely.N)Úsetra   r#   r   ÚDuplicateHelpPrefixÚadd)r   Úprefixesr-   r#   s       r   Ú_check_prefix_uniquenessz$HelpIndices._check_prefix_uniqueness•   s_   € å‘5”5ˆØÔ%ð 	!ð 	!ˆEØ”\ˆFØ˜Ð!Ð!ÝÔ0°Ñ8Ô8Ð8Ø�LŠL˜Ñ Ô Ð Ð ð		!ð 	!r   c                 óÒ   ‡— |                       ¦   «          g }| j        D ]6Š|                     ˆfd„‰                     |¦  «        D ¦   «         ¦  «         Œ7|st	          |¦  «        ‚|S )a  Search 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'.
        c                 ó   •— g | ]}‰|f‘ŒS r   r   )r8   Ú_topicr-   s     €r   r>   z&HelpIndices.search.<locals>.<listcomp>¨   s3   ø€ ð Bð Bð BØ%ð " 6˜?ð Bð Bð Br   )rg   ra   ÚextendÚ
get_topicsr   )r   r   Úresultr-   s      @r   r    zHelpIndices.searchž   s¥   ø€ ð 	×%Ò%Ñ'Ô'Ð'ØˆØÔ%ð 	Cð 	CˆEØ�MŠMð Bð Bð Bð BØ).×)9Ò)9¸%Ñ)@Ô)@ðBñ Bô Bñ Cô Cð Cð Càð 	Ý˜eÑ$Ô$Ð$àˆMr   N)r   r   r   Ú__doc__r   rg   r    r   r   r   r   r   ~   sK   € € € € € ðð ðð ð ð!ð !ð !ðð ð ð ð r   r   )NNr   )rA   r   r   r   r   r   r   r   r	   ÚBzrErrorr   r0   r3   r2   Útopic_registryÚregisterÚSECT_HIDDENr   r   r   r   ú<module>rs      sP  ðð0ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ðð ð ð ð �&”/ñ ô ð ðRð Rð Rð Rð26ð 6ð 6ð 6ð%ð %ð %ðP Ô × #Ò # JØ$:Ø$AØ$/Ô$;ñ=ô =ð =ð Ô × #Ò #Ð$5Ø$:Ø$9Ø$/Ô$;ñ=ô =ð =ð/ð /ð /ð /ð /ñ /ô /ð /ð /ð /r   