%PDF- %PDF-
Direktori : /snap/core20/2318/lib/python3/dist-packages/urwid/__pycache__/ |
Current File : //snap/core20/2318/lib/python3/dist-packages/urwid/__pycache__/container.cpython-38.pyc |
U ��dZ2L � @ s� d dl mZmZ d dlmZmZ d dlmZ d dlm Z d dl mZmZm Z mZmZmZmZmZmZmZmZmZmZmZmZmZ d dlmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z' d dl(m)Z)m*Z* d dl+m,Z,m-Z-m.Z.m/Z/m0Z0 G d d � d e1�Z2G dd� de1�Z3G d d� de4�Z5G dd� dee2e3�Z6G dd� de4�Z7G dd� dee2e3�Z8G dd� de4�Z9G dd� dee2�Z:G dd� de4�Z;G dd� dee2e3�Z<G dd� de4�Z=G dd � d ee2e3�Z>d!d"� Z?e@d#k�r�e?� d$S )%� )�division�print_function)�chain�repeat)�xrange)�is_mouse_press)�Widget�Divider�FLOW�FIXED�PACK�BOX� WidgetWrap�GIVEN�WEIGHT�LEFT�RIGHT�RELATIVE�TOP�BOTTOM�CLIP�RELATIVE_100)�Padding�Filler�calculate_left_right_padding�calculate_top_bottom_filler�normalize_align�normalize_width�normalize_valign�normalize_height�simplify_align�simplify_width�simplify_valign�simplify_height)� MonitoredList�MonitoredFocusList)�CompositeCanvas� CanvasOverlay� CanvasCombine�SolidCanvas� CanvasJoinc @ s0 e Zd ZdZdd� Zdd� Zdd� Zdd � Zd S )�WidgetContainerMixinzQ Mixin class for widget containers implementing common container methods c C s | j | d jS )aG Container short-cut for self.contents[position][0].base_widget which means "give me the child widget at position without any widget decorations". This allows for concise traversal of nested container widgets such as: my_widget[position0][position1][position2] ... r )�contents�base_widget��selfZposition� r0 �1/usr/lib/python3/dist-packages/urwid/container.py�__getitem__+ s z WidgetContainerMixin.__getitem__c C sD g }| }z |j }W n tk r* | Y S X |�|� |jj}qdS )z� Return the .focus_position values starting from this container and proceeding along each child widget until reaching a leaf (non-container) widget. N)�focus_position� IndexError�append�focusr- )r/ �out�w�pr0 r0 r1 �get_focus_path8 s z#WidgetContainerMixin.get_focus_pathc C s* | }|D ]}||j kr||_ |jj}qdS )a� Set the .focus_position property starting from this container widget and proceeding along newly focused child widgets. Any failed assignment due do incompatible position types or invalid positions will raise an IndexError. This method may be used to restore a particular widget to the focus by passing in the value returned from an earlier call to get_focus_path(). positions -- sequence of positions N)r3 r6 r- )r/ Z positionsr8 r9 r0 r0 r1 �set_focus_pathH s z#WidgetContainerMixin.set_focus_pathc C s, g }| }|j j}|dkr|S |�|� qdS )aW Return the .focus values starting from this container and proceeding along each child widget until reaching a leaf (non-container) widget. Note that the list does not contain the topmost container widget (i.e., on which this method is called), but does include the lowest leaf widget. N)r- r6 r5 )r/ r7 r8 r0 r0 r1 �get_focus_widgets[ s z&WidgetContainerMixin.get_focus_widgetsN)�__name__� __module__�__qualname__�__doc__r2 r: r; r<