%PDF- %PDF-
Direktori : /usr/share/hplip/base/__pycache__/ |
Current File : //usr/share/hplip/base/__pycache__/tui.cpython-312.pyc |
� = f*7 � �� � d dl Z d dlZddl� ddlmZ ddlmZ ddlmZ dd�Z dd�Z dd �Zd � Zd� Z dd�Zd � Zd� Zd d�Zdd�Zd� Z G d� de� Z G d� de� Zd ZdZdZdefd�Zdefd�Zd� Zd!d�Zd� Zy)"� N� )�*)�utils)�PY3)�inputc �d � t |� t d� k( r |dk( rd}nd}|�|r| dz } n| dz } n| |z } t t j | � � j � j � }|sd|fS |dk( ry|dk( ry |d v rd|fS t j d� �k# t $ r Y �ww xY w)N� �yTFz (y=yes*, n=no, q=quit) ? z (y=yes, n=no*, q=quit) ? �n)TF)TT)�q�cz/Please press <enter> or enter 'y', 'n', or 'q'.)�typer �log�bold�lower�strip�EOFError�error)�question� default_value� choice_prompt� user_inputs �/usr/share/hplip/base/tui.py�enter_yes_nor ! s� � ��M��d�2�h�&��C�� �M�!�M� ����4�4�H��4�4�H��M�!�� � ��s�x�x��1�2�8�8�:�@�@�B�J� ���&�&�����������#��-�'�'�� � �C�D�% �� � �� �s �:B# �# B/�.B/c �v � t t j | � � j � j � }|s|�d|fS |dk( rd|fS t |� }||k s||kD rt j d||fz � �~d|fS # t $ r Y ��w xY w# t $ r t j d||fz � Y ��w xY w)NTr Fz8Please enter a number between %d and %d, or "q" to quit.) r r r r r r �int� ValueErrorr )r � min_value� max_valuer r � value_ints r �enter_ranger! G s� � � � ��s�x�x��1�2�8�8�:�@�@�B�J� ��(��]�*�*�����-�'�'� ��J��I� �y� �I� �$9��I�I�P��I�&�'� (���Y����- � �� �� � ��I�I�P��I�&�'� (�� �s# �:B �B � B�B�#B8�7B8c � � d|vr|j d� t t j | � � j � j � }|s|s||k( r |dk( rd|fS d|fS |dk( rd|fS ||v rd|fS t j ddj |D �cg c] }d|z �� c}� �d|�d�� ��# t $ r Y ��w xY wc c}w ) Nr TFz Please enter z, z'%s'z& or press <enter> for the default of 'z'.) �appendr r r r r r r �join)r �choicesr r �xs r �enter_choicer'