File: //usr/lib/python3/dist-packages/boto/mashups/__pycache__/iobject.cpython-310.pyc
o
ckF[_ � @ s$ d dl Z dd� ZG dd� de�ZdS )� Nc C s zt | � W dS Y dS )NTF)�int)�v� r �6/usr/lib/python3/dist-packages/boto/mashups/iobject.py�
int_val_fn s
r c @ s4 e Zd Z ddd�Zd
dd�Zdd � Zd
d� ZdS )�IObject� �Enter Selectionc
C sx |st d� d S d }|s�d}g }|D ]R}t|t�r+t d||f � |�|� |d7 }q|\}} }
|
rL|
�|�dkrKt d|| |
f � |�|� |d7 }q| �|�dkrdt d|| f � |�|� |d7 }q|r�td|t|�f �}|�d�r}|dd � }n;zt|�}|dkr�W d S ||d }W n' t y� t d| � Y n t
y� t d |t|�f � Y nw t d
� d}|r|S )NzNo Choices Available� z[%d] %sr z[%d] %s - %sz
%s[1-%d]: �/z%s is not a valid choicez %s is not within the range[1-%d]zNo objects matched your patternr )�print�
isinstance�
basestring�append�find� raw_input�len�
startswithr �
ValueError�
IndexError)
�self� item_list�
search_str�prompt�choice�n�choices�item�obj�id�desc�val�int_valr r r �choose_from_list sX
�
�
���&zIObject.choose_from_listNc C s>