�
�&=d� � �� � d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dl Z d dl
mZ d dlZn
# e
$ r dZY nw xY wd dlmZmZ d dlmZmZmZmZmZ d dlmZ d dlZe j � � � ZdZ ej d� � � � � \ Z Z! e"e � � pd e"e!� � pd cZ#Z$n# e%$ r d
\ Z#Z$Y nw xY wd� Z&e&Z'e&Z(d� Z)d,d�Z*e�- ej+ d� � ej, d� � n# e%$ r Y nw xY wd� Z- G d� de.� � Z/d-d�Z0d.d�Z1d/d�Z2d� Z3e3Z4 d0d�Z5d� Z6d1d�Z7d� Z8d2d�Z9d-d�Z: d3d �Z; d4d"�Z< d5d#�Z=d$� Z>d%� Z?d&� Z@d/d'�ZAd6d)�ZBd*� ZCd+� ZDdS )7� N)�suppress)�debbugs� hiermatch)�NoReport� NoPackage�NoBugs�
QuertBTSError�InvalidRegex)�launch_browserzus-asciiz stty size� �O )r r
c � � t sd S |r| |z } t j � | � � t j � � � d S �N)�ISATTY�sys�stderr�write�flush)�message�argss �6/usr/lib/python3/dist-packages/reportbug/ui/text_ui.py�ewriter 8 sP � �� ���� !��D�.���J���W�����J�������� c � � t j � � }n$# t $ r t j d� � Y nw xY wt j | � � S )N�/)�os�getcwd�OSError�chdir�system)�cmdline�_s r r r G sP � ���I�K�K����� � � �
���
�
�
�
�
�����
�9�W���s � �7�7� c �� � |s
t dz
}|rd|z }nd}d� | � � � � � } | s|dz S t j | |||�� � }|� d� � r|S |dz S )z.Wrapper for textwrap.fill to the existing API.� � r# �
)�width�initial_indent�subsequent_indent)�columns�join�split�textwrap�fill�endswith)�text� starttext�indent�linelen�si�outputs r �indent_wrap_textr7 O s� � �� ��A�+��
� �
�6�\���
���8�8�D�J�J�L�L�!�!�D�� ��4���
�]�4�w�y�-/�1� 1� 1�F�
���t��� ��
��D�=�r z
tab: completer& |