403Webshell
Server IP : 50.21.180.56  /  Your IP : 216.73.216.139
Web Server : Apache
System : Linux info 3.0 #1337 SMP Tue Jan 01 00:00:00 CEST 2000 all GNU/Linux
User : ws67922704 ( 67922704)
PHP Version : 8.5.13
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /kunden/proc/self/root/usr/lib/python3/dist-packages/breezy/ui/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /kunden/proc/self/root/usr/lib/python3/dist-packages/breezy/ui/__pycache__/text.cpython-313.pyc
�

p��gj��"�SrSSKrSSKrSSKrSSKrSSKrSSKJr \"\"5S5 SSKJ	r	J
r
Jr SSKJrJ
r
 "S	S
5r\	R"SSS
/SSS9r"SS\
5rSSjr"SS5rSrSrSSjrSSjr"SS5rg)z%Text UI, write output to the console.�N�)�lazy_importzB
import time

from breezy import (
    debug,
    progress,
    )
)�config�osutils�trace�)�NullProgressView�	UIFactoryc�<�\rSrSrSrSrSrSrSrSr	Sr
S	rg
)�	_ChooseUI�+z'Helper class for choose implementation.c�T�XlUR5 URX#U5 g�N)�ui�_setup_mode�_build_alternatives)�selfr�msg�choices�defaults     �0/usr/lib/python3/dist-packages/breezy/ui/text.py�__init__�_ChooseUI.__init__.s#��������� � ��w�7�c�F�URRR5n[RRS5S:waGURR[
[R5:XaU(aSUl	SUl
gSUl	U(+Ul
g)z�Setup input mode (line-based, char-based) and echo-back.

Line-based input is used if the BRZ_TEXTUI_INPUT environment
variable is set to 'line-based', or if there is no controlling
terminal.
�BRZ_TEXTUI_INPUTz
line-basedFTN)r�	raw_stdin�isatty�os�environ�get�_unwrap_stream�sys�stdin�
line_based�	echo_back)r�is_ttys  rr�_ChooseUI._setup_mode3sn�����"�"�)�)�+���J�J�N�N�-�.�,�>����!�!�^�C�I�I�%>�>��#�D�O�!�D�N�"�D�O�!'�Z�D�Nrc��Sn/n0UlURS5nUb$U[S[U55;a[	S5eUGHWnURSS5R
5nXt4nXpR;a[	SRU55eX�RU'URS5n	U	S:wa9U	S	-[U5:a'USU	n
U
S
XiS	--S--
n
X�U	S-S-
n
XiS	-n	O+URSS5nUSn	S
RX�S	S5n
U	R
5n	X�R;a[	SRU	55eX�RU	'XC:XaX�RS'X�RS'URU
5 US	-
nGMZ SRUSRU55Ulg)z]Parse choices string.

Setup final prompt and the lists of choices and associated
shortcuts.
r�
Nzinvalid default index�&�zduplicated choice: {}���r�[�]rz[{}]{}zduplicated shortcut: {}�
z	{} ({}): z, )�alternatives�split�range�len�
ValueError�replace�lower�format�find�append�join�prompt)rrrr�index�	help_list�c�name�choice�shortcut�helps           rr�_ChooseUI._build_alternativesFs������	�����-�-��%����7�%��3�w�<�2H�#H��4�5�5��A��9�9�S�"�%�+�+�-�D��]�F��(�(�(� �!8�!?�!?��!E�F�F�&,���d�#��v�v�c�{�H��2�~�8�a�<�3�q�6�"9���(�|����a�1��o�-��3�3���8�a�<�*�+�+����\�?���I�I�c�2�&���Q�4�����x�1�2��7���~�~�'�H��,�,�,� �!:�!A�!A�(�!K�L�L�*0���h�'���(.�!�!�"�%�*0�!�!�$�'����T�"��Q�J�E�3�6"�(�(��d�i�i�	�.B�C��rc��URRR5nUS:Xa[eUR	5$)Nr,)rr$�readline�EOFError�strip)r�lines  r�_getline�_ChooseUI._getlineos0���w�w�}�}�%�%�'���2�:��N��z�z�|�rc���[R"5nU[S5:Xa[eU[S5:Xa[e[U[5(aURSS5$U$)N���asciir6)r�getchar�chr�KeyboardInterruptrG�
isinstance�bytes�decode)r�chars  r�_getchar�_ChooseUI._getcharusR����� ���3�q�6�>�#�#��3�q�6�>��N��d�E�"�"��;�;�w�	�2�2��rc��UR(a
URnOURnSnUS-
nUS:XdUR(a%URR	UR5 U"5nUR5nX0R;aMkURUupEUR(a(URRRUS-5 U$![
a( URRRS5 g[a' URRRS5 ef=f)z2Keep asking the user until a valid choice is made.rrr*N)r%rJrWrr<rG�stderr�writerRr7r1r&)r�	getchoice�iterrAr@r=s      r�interact�_ChooseUI.interacts����?�?��
�
�I��
�
�I�����A�I�D��q�y�D�O�O������t�{�{�+�
�"����\�\�^�F��.�.�.���+�+�F�3�K�D��~�~������$�$�T�D�[�1��L���
������$�$�T�*��$�
������$�$�T�*��
�s�0C$�$/E�0E)r1r&r%r<rN)�__name__�
__module__�__qualname__�__firstlineno__�__doc__rrrrJrWr^�__static_attributes__�rrrr+s%��1�8�
(�&'D�R��rr�progress_barzProgress bar type.�BRZ_PROGRESS_BAR�error)rC�default_from_envr�invalidc�^�\rSrSrSrU4SjrSrSrSSjrSr	Sr
S	rS
rSSjr
SrS
rSrSrSrSrSSjrSrSrSrSrSrSrSrU=r$)�
TextUIFactory�z&A UI factory for Text user interfaces.c�d>�[TU]5 XlX lX0l[5Ulg)zCreate a TextUIFactory.N)�superrr$�stdoutrZr	�_progress_view)rr$rqrZ�	__class__s    �rr�TextUIFactory.__init__�s(���
�����
�����.�0��rc�P�UR5 UR5UlU$r)�_setup_streams�make_progress_viewrr�rs r�	__enter__�TextUIFactory.__enter__�s$������"�5�5�7����rc�<�[UR5Ul[UR5Ul[UR5Ul[
UR
5Ul[UR5Ul[
UR5Ulgr)	r"r$r�_wrap_in_streamrq�
raw_stdout�_wrap_out_streamrZ�
raw_stderrrxs rrv�TextUIFactory._setup_streams�sb��'��
�
�3���$�T�^�^�4��
�(����5���&�t���7���(����5���&�t���7��rc�:�[XX#5nUR5$)aUPrompt the user for a list of alternatives.

Support both line-based and char-based editing.

In line-based mode, both the shortcut and full choice name are valid
answers, e.g. for choose('prompt', '&yes\n&no'): 'y', ' Y ', ' yes',
'YES ' are all valid input lines for choosing 'yes'.

An empty line, when in line-based mode, or pressing enter in char-based
mode will select the default choice (if any).

Choice is echoed back if:
- input is char-based; which means a controlling terminal is available,
  and osutils.getchar is used
- input is line-based, and no controlling terminal is available
)rr^)rrrr�	choose_uis     r�choose�TextUIFactory.choose�s��"�d��:�	��!�!�#�#rc��U(a!UR(dUR5 [R"X5 UR	5Ulgr)�_quiet�
clear_termr
�be_quietrwrr)r�states  rr��TextUIFactory.be_quiet�s4�������O�O�����4�'�"�5�5�7��rc�8�URR5 g)zuPrepare the terminal for output.

This will, clear any progress bars, and leave the cursor at the
leftmost position.
N�rr�clearrxs rr��TextUIFactory.clear_term�s��	
���!�!�#rc��URU5 URR5n[U5$![a Of=fMIr)r<r$rF�intr5)rr<rIs   r�get_integer�TextUIFactory.get_integer�sI����K�K����:�:�&�&�(�D�
��4�y� ���
��
��s�
9�
A�Ac���[URSS5nUb#U"5(aSSKnURS5nU$URR5nU(dSnU$USS:XaUSSnU$)Nrrr,r-r*)�getattrr$�getpassrF)rrr��passwords    r�get_non_echoed_password�%TextUIFactory.get_non_echoed_password�s{������X�t�4����&�(�(�����r�*�H���
�z�z�*�*�,�H�������B�<�4�'�'���}�H��rc�R�US-
nUR"U40UD6 UR5$)aDPrompt the user for a password.

:param prompt: The prompt to present the user
:param kwargs: Arguments which will be expanded into the prompt.
               This lets front ends display different things if
               they so choose.
:return: The password string, return None if the user
         canceled the request.
�: )r<r��rr<�kwargss   r�get_password�TextUIFactory.get_passwords/��	�$������F�%�f�%��+�+�-�-rc��US-
nUR"U40UD6 URR5nU(dSnU$USS:XaUSSnU$)aDPrompt the user for a username.

:param prompt: The prompt to present the user
:param kwargs: Arguments which will be expanded into the prompt.
               This lets front ends display different things if
               they so choose.
:return: The username string, return None if the user
         canceled the request.
r�Nr-r*)r<r$rF)rr<r��usernames    r�get_username�TextUIFactory.get_usernames]��	�$������F�%�f�%��:�:�&�&�(����H�����|�t�#�#�C�R�=���rc�:�UR5(a
[5$[R"5R	S5nUS:Xa
[5$US:Xd$[
R
UR5(a[UR5$[5$)z=Construct and return a new ProgressView subclass for this UI.rg�none�text)	�is_quietr	r�GlobalStackr!�progress�_supports_progressrZ�TextProgressView)r�pb_types  rrw� TextUIFactory.make_progress_view$sw���=�=�?�?�#�%�%��$�$�&�*�*�>�:���f��#�%�%��v���*�*�4�;�;�7�7�#�D�K�K�0�0��!�!rc�.�[XRX5$r)�TextUIOutputStreamrq)r�encoding�
encoding_types   r�_make_output_stream_explicit�*TextUIFactory._make_output_stream_explicit7s��!�$���X�M�Mrc�`�UR5 URRUS-5 g)zKWrite an already-formatted message, clearing the progress bar if necessary.r*N)r�rqr[�rrs  r�note�TextUIFactory.note:s"�����������#��*�%rc�6�[U[5(d[SRU55eU(aX-nUR	5 UR
R
5 URRU5 URR
5 g)z�Emit prompt on the CLI.

:param kwargs: Dictionary of arguments to insert into the prompt,
    to allow UIs to reformat the prompt.
z prompt {!r} not a unicode stringN)	rS�strr5r8r�rq�flushrZr[r�s   rr<�TextUIFactory.prompt?sn���&�#�&�&��?�F�F�v�N�O�O���_�F����������������&�!������rc�<�URRXU5 g)z~Called by transports as they do IO.

This may update a progress bar, spinner, or similar display.
By default it does nothing.
N)rr�show_transport_activity)r�	transport�
byte_count�	directions    r�report_transport_activity�'TextUIFactory.report_transport_activityOs��	
���3�3�I�*�Urc�F�[URSS5nUbU"US9 gg)z'See UIFactory.log_transport_activity().�log_transport_activityN)�display)r�rr)rr��logs   rr��$TextUIFactory.log_transport_activityWs)���d�)�)�+C�T�J���?��� �rc�x�UR5 URRSRU55 g)Nzbzr: error: {}
�r�rZr[r8r�s  r�
show_error�TextUIFactory.show_error]s*�����������,�3�3�C�8�9rc�&�URU5 gr)r�r�s  r�show_message�TextUIFactory.show_messageas
���	�	�#�rc�x�UR5 URRSRU55 g)Nzbzr: warning: {}
r�r�s  r�show_warning�TextUIFactory.show_warningds*�����������.�5�5�c�:�;rc���UR(d%[R"SRU5SS9 OXRS:waURRU5 g)z2A task has been updated and wants to be displayed.z${!r} updated but no tasks are activer)�
stacklevelr-N)�_task_stack�warnings�warnr8rr�
show_progress)r�tasks  r�_progress_updated�TextUIFactory._progress_updatedhsT������M�M�6�=�=�d�C�PQ�
��%�%�b�)�
)�
����)�)�$�/rc�8�URR5 grr�rxs r�_progress_all_finished�$TextUIFactory._progress_all_finishedws�����!�!�#rc��XR;a0URX5nURRUS-5 gg)ziShow a text message to the user.

Explicitly not for warnings about bzr apis, deprecations or internals.
r*N)�suppressed_warnings�format_user_warningrZr[)r�
warning_id�message_args�warnings    r�show_user_warning�TextUIFactory.show_user_warningzs;���5�5�5��.�.�z�H�G��K�K���g��n�-�6r)rrrrr}rZr$rqr)r,�F)r`rarbrcrdrryrvr�r�r�r�r�r�r�rwr�r�r<r�r�r�r�r�r�r�r�re�
__classcell__)rss@rrmrm�s{���0�1��8�$�(8�
$���$.� �("�&N�&�
� V�!�:��<�
0�$�
.�
.rrmc�R�URUS5nSXU4-RU5$)z�Truncate or pad unicode line to width.

This is best-effort for now, and strings containing control codes or
non-ascii text may be cut and padded incorrectly.
r6s%-*.*s)�encoderU)rI�width�
encoding_hint�ss    r�pad_to_widthr��s/��	
���M�9�-�A���q�)�)�1�1�-�@�@rc�h�\rSrSrSrSSjrSrSrSrSr	S	r
S
rSrSr
S
rSrSSjrSrg)r�i�a�Display of progress bar and other information on a tty.

This shows one line of text, including possibly a network indicator,
spinner, progress bar, message, etc.

One instance of this is created and held by the UI, and fed updates when a
task wants to be painted.

Transports feed data to this through the ui_factory object.

The Progress views can comprise a tree with _parent_task pointers, but
this only prints the stack from the nominated current task up to the root.
Nc�
�XlUc[USS5=(d SUlOX lSUlSUlSUlSUlSUlSUlSUl	SUl
SSSS.UlSUlSUl
SUlg)Nr�rOFr,r)�unknown�readr[)�
_term_filer��	_encoding�_have_output�_last_transport_msg�	_spin_pos�
_last_repaint�_transport_update_time�
_last_task�_total_byte_count�_bytes_since_update�_bytes_by_direction�_first_byte_time�	_fraction�
enable_bar)r�	term_filer��errorss    rr�TextProgressView.__init__�s���#����$�Y�
�D�A�L�W�D�N�%�N�!���#%�� �������&'��#����!"���#$�� �/0�!�a�#H�� � $������ ��rc�>�[R"5nUcgUS-
$)Nr)r�terminal_width)r�ws  r�_avail_width�TextProgressView._avail_width�s!���"�"�$���9���q�5�Lrc��UR5nUb[XURS9nURR	SU-S-5 g)N)r�r0)rr�r�r�r[)r�ur�s   r�
_show_line�TextProgressView._show_line�s@���!�!�#�����Q�T�^�^�D�A������d�Q�h��o�.rc�V�UR(aURS5 SUlg)Nr,F)r�r	rxs rr��TextProgressView.clear�s������O�O�B��!��rc���UR(Ga
URbURR(a�SURS-nU=RS-
slSnURc
SnSUlO#URR5=(d SnX0R:a(S[R;a[R5 X0l[[[U5U-55S-
nSSU-U-RU5-S	-nU$URbURR(a,SURS-nU=RS-
slUS
-$g)Nz/-\|rNr�rr�r.�#z] � r,)r�r��show_barr�r��_overall_completion_fraction�debug�debug_flags�	set_tracer��round�float�ljust�show_spinner)r�spin_str�cols�completion_fraction�markers�bar_strs      r�_render_bar�TextProgressView._render_bar�s-���?�?�?����!8�T�_�_�=U�=U��t�~�~��1�2�H��N�N�a��N��D����&�&'�#�!"����O�O�@�@�B�G�a�$�#�^�^�3�
�e�FW�FW�8W����!�0�N��%��d��.A� A�B�C�a�G�G��S�7�]�X�5�<�<�T�B�B�T�I�G��N��o�o�%�$�/�/�*F�*F��t�~�~��1�2�H��N�N�a��N��c�>�!�rc��UR(dSnOUURb)URbSURUR4-nOURbSUR-nOSnUnURnUR(aBURnUR(aURS-U-nUR(aMBXB4$)zgFormat task-specific parts of progress bar.

:returns: (text_part, counter_part) both unicode strings.
r,z %d/%dz %d�:)�
show_count�current_cnt�	total_cntr�_parent_task)rr�r��t�ms     r�_format_task�TextProgressView._format_task�s���
����A�
�
�
�
)�d�n�n�.H��D�,�,�d�n�n�=�=�A�
�
�
�
)���)�)�*�A��A����H�H���n�n����A��u�u��E�E�C�K�!�O���n�n�n��t�rc�d�UR5nUR(aURUR5up#OS=p#UR(aURR(dSnOURnU(dU(a	U(dSnUR5nUbE[
U5[
U5-[
U5-[
U5-nXe-
nUS:�aUSU*S-
S-nXA-U-U-nUb6[
U5U:aURU5nU$[
U5U:�aUSUnU$)Nr,z| rrz..)rr�r)r�r�rr4r)	r�
bar_string�	task_part�counter_part�trans�avail_width�current_len�gapr�s	         r�_render_line�TextProgressView._render_lines(���%�%�'�
��?�?�&*�&7�&7����&H�#�I�|�')�)�I��?�?�4�?�?�#J�#J��E��,�,�E�
��
��J��'�'�)���"��J��#�e�*�,�s�9�~�=��L�@Q�Q�
��+�C��Q�w�%�j���q��1�D�8�	����*�\�9���"��1�v��#��G�G�K�(�����Q��+�%��l�{�O���rc�T�UR5nURU5 SUlg)NT)r3r	r�)rr�s  r�_repaint�TextProgressView._repaint$s$������������ ��rc��XRLnXl[R5nU(dX0RUR-:agX0RS-:�aSUlX0lUR
5 g)z�Called by the task object when it has changed.

:param task: The top task object; its parents are also included
    by following links.
N�
r,)r��timer��update_latencyr�r�r6)rr��must_update�nows    rr��TextProgressView.show_progress)sd���/�/�1�����i�i�k���#�(:�(:�T�=P�=P�(P�"P���,�,�r�1�1�')�D�$� ���
�
�rc��U=RU-
slU=RU-
slURc[R5UlX R;aURU==U-
ss'OURS==U-
ss'S[
R;ag[R5nURS:agURcX@lgX@RS-:�aeURX@R-
-nSURS-[U5S-4-nX@lX@l	SUlX`l
UR5 gg)	z�Called by transports via the ui_factory, as they do IO.

This may update a progress bar, spinner, or similar display.
By default it does nothing.
Nr��no_activityi�g�?z%6dkB %5dkB/s i�r)r�r�r�r:r�rrr�r�r�r�r6)rr�r�r�r=�raters       rr��(TextProgressView.show_transport_activity:s<��	
���*�,��� � �J�.� �� � �(�%)�I�I�K�D�!��0�0�0��$�$�Y�/�:�=�/��$�$�Y�/�:�=�/��E�-�-�-�

��i�i�k���!�!�D�(�
��&�&�.�*-�'�
�0�0�3�6�
7��+�+�s�5P�5P�/P�Q�D�"��&�&��-��D�	�D� �&��C�+.�'�!$��'(�D�$�'*�$��M�M�O�8rc��URcSnO8[R5UR-
nUS:aSnURU-nSRURS-US-URSS-URSS-5nURSS:�aUS	URSS---
nU$US
-
nU$)Ngg����MbP?z7Transferred: {:.0f}kB ({:.1f}kB/s r:{:.0f}kB w:{:.0f}kBg@�@r�r[r�rz
 u:%.0fkB)�))r�r:r�r8r�)r�bps�
transfer_timers    r�_format_bytes_by_direction�+TextProgressView._format_bytes_by_directionis���� � �(��C� �I�I�K�$�*?�*?�?�M��u�$� %�
��(�(�=�8�C�H�N�N��"�"�V�+��&�L��$�$�V�,�v�5��$�$�W�-��6�	
���#�#�I�.��2��<�4�#;�#;�I�#F��#O�P�P�C��
�
�3�J�C��
rc���UR5n[R"U5 U(a@URS:�a/UR	5 UR
R
US-5 ggg)Nrr*)rGr�mutterr�r�r�r[)rr�rs   rr��'TextProgressView.log_transport_activitysR���-�-�/��
���S���t�-�-��1��J�J�L��O�O�!�!�#��*�-�2�7r)r�r�r�r�r�r�r�r�r�r�r�r�r�r�)NNr�)r`rarbrcrdrrr	r�rr)r3r6r�r�rGr�rerfrrr�r��sF��� �0�/�"�
�@�,!�F!�
�"-�^�,.rr�c��[R"5RS5nUc
[USS5nUc[R
"SS9nU$)N�output_encodingr�T)r)rr�r!r�r�get_terminal_encoding)�streamr�s  r�_get_stream_encodingrP�sK���!�!�#�'�'�(9�:�H����6�:�t�4�����0�0�t�<���Orc�@�[USS5nUc
[USU5nU$)N�bufferrO)r�)rO�inners  rr"r"�s(���F�H�d�+�E��}����&�1���Lrc���Uc[U5nUR5n[X1USS9$![Ra% [
R"U5"XS9nXlUs$f=f)Nr)r�r�	buffering�r)rP�fileno�open�io�UnsupportedOperation�codecs�	getreaderr�)rOr�rrW�encoded_streams     rr|r|�sl����'��/��K�������F�f��J�J���"�"���)�)�(�3�F�J��"*�����s�+�6A$�#A$c�b�Uc[U5n[R"U5"XS9nXlU$)NrV)rPr[�	getwriterr�)rOr�rr]s    rr~r~�s3����'��/���%�%�h�/��F�N�&���rc�:�\rSrSrSrS
SjrSrSrSrSr	S	r
g)r�i�a�Decorates stream to interact better with progress and change encoding.

Before writing to the wrapped stream, progress is cleared. Callers must
ensure bulk output is terminated with a newline so progress won't overwrite
partial lines.

Additionally, the encoding and errors behaviour of the underlying stream
can be changed at this point. If errors is set to 'exact' raw bytes may be
written to the underlying stream.
Nc���Xl[U5nSUlUS:XaSnXPlUcX lUc[	U5nO*[XSU5UlUcURRnX0lX@lg)N�exact�strict)�
ui_factoryr"�
raw_stream�wrapped_streamrPr~r�r)rrdrOr�rrSs      rr�TextUIOutputStream.__init__�sv��$���v�&������W���F�#�O��=�"(����/��7���"2�5�F�"K�D�����.�.�7�7�� �
��rc��[U[5(a'URURUR5nURRU5 g![
a URRU5 gf=fr)	rSrTrUr�r�UnicodeDecodeErrorrer[rf�r�to_writes  r�_write�TextUIOutputStream._write�sh���h��&�&�
�#�?�?�4�=�=�$�+�+�F��	
���!�!�(�+��&�
����%�%�h�/��
�s�&A�%B�Bc�l�URR5 URR5 gr)rdr�rfr�rxs rr��TextUIOutputStream.flush�s$�����"�"�$����!�!�#rc�Z�URR5 URU5 gr�rdr�rlrjs  rr[�TextUIOutputStream.write�s�����"�"�$����H�rc�l�URR5 UHnURU5 M grrq)r�linesrIs   r�
writelines�TextUIOutputStream.writelines�s(�����"�"�$��D��K�K���r)r�rrerdrf)Nrc)r`rarbrcrdrrlr�r[rurerfrrr�r��s ��	��&,�$��rr�)rO)Nr6)rdr[rYrr#r�r�globalsr,rrrr	r
r�Option�opt_progress_barrmr�r�rPr"r|r~r�rfrr�<module>rzs���",�
�	�	�
��%���I��
�&�%�)�n�n�b�=�=��	�(�)�����_.�I�_.�DA�s.�s.�l��K��3�3r

Youez - 2016 - github.com/yon3zu
LinuXploit