Current Dir: /snap/core22/2437/usr/lib/python3/dist-packages/urwid/__pycache__/
[FILE] canvas.cpython-310.pyc [ edit | delete | rename ]
[FILE] command_map.cpython-310.pyc [ edit | delete | rename ]
[FILE] compat.cpython-310.pyc [ edit | delete | rename ]
[FILE] container.cpython-310.pyc [ edit | delete | rename ]
[FILE] curses_display.cpython-310.pyc [ edit | delete | rename ]
[FILE] decoration.cpython-310.pyc [ edit | delete | rename ]
[FILE] display_common.cpython-310.pyc [ edit | delete | rename ]
[FILE] escape.cpython-310.pyc [ edit | delete | rename ]
[FILE] font.cpython-310.pyc [ edit | delete | rename ]
[FILE] graphics.cpython-310.pyc [ edit | delete | rename ]
[FILE] html_fragment.cpython-310.pyc [ edit | delete | rename ]
[FILE] lcd_display.cpython-310.pyc [ edit | delete | rename ]
[FILE] listbox.cpython-310.pyc [ edit | delete | rename ]
[FILE] main_loop.cpython-310.pyc [ edit | delete | rename ]
[FILE] monitored_list.cpython-310.pyc [ edit | delete | rename ]
[FILE] numedit.cpython-310.pyc [ edit | delete | rename ]
[FILE] old_str_util.cpython-310.pyc [ edit | delete | rename ]
[FILE] raw_display.cpython-310.pyc [ edit | delete | rename ]
[FILE] signals.cpython-310.pyc [ edit | delete | rename ]
[FILE] split_repr.cpython-310.pyc [ edit | delete | rename ]
[FILE] text_layout.cpython-310.pyc [ edit | delete | rename ]
[FILE] treetools.cpython-310.pyc [ edit | delete | rename ]
[FILE] util.cpython-310.pyc [ edit | delete | rename ]
[FILE] version.cpython-310.pyc [ edit | delete | rename ]
[FILE] vterm.cpython-310.pyc [ edit | delete | rename ]
[FILE] web_display.cpython-310.pyc [ edit | delete | rename ]
[FILE] widget.cpython-310.pyc [ edit | delete | rename ]
[FILE] wimp.cpython-310.pyc [ edit | delete | rename ]
[FILE] _async_kw_event_loop.cpython-310.pyc [ edit | delete | rename ]
[FILE] __init__.cpython-310.pyc [ edit | delete | rename ]
Viewing: /snap/core22/2437/usr/lib/python3/dist-packages/urwid/__pycache__/widget.cpython-310.pyc
o
��o_�� � @ st d dl mZmZ d dlmZ d dlmZmZ d dlm Z m
Z
mZmZm
Z
mZ d dlmZmZmZ d dlmZ d dlmZ d dlmZmZmZmZ d d lmZmZmZmZm Z m!Z!m"Z" d d
l#m$Z$m%Z%m&Z& dZ'dZ(d
Z)dZ*dZ+dZ,dZ-dZ.dZ/dZ0dZ1dZ2dZ3dZ4dZ5dZ6e6dfZ7dZ8G dd� de ej9�Z:G dd � d e;�Z<d!d"� Z=d#d$� Z>d%d&� Z?d'd(� Z@d)d*� ZAd+d,� ZBG d-d.� d.ee:eC��ZDG d/d0� d0eD�ZEG d1d2� d2eD�ZFd3d4� ZGG d5d6� d6eD�ZHG d7d8� d8eD�ZIG d9d:� d:eF�ZJG d;d<� d<e;�ZKG d=d>� d>eD�ZLG d?d@� d@eK�ZMG dAdB� dBeL�ZNG dCdD� dDeN�ZOdEdF� ZPG dGdH� dHe;�ZQG dIdJ� dJePdK�eD�ZRdLdM� ZSeTdNk�r8eS� dOS dOS )P� )�division�print_function)�
attrgetter)� text_type�with_metaclass)� MetaSuper�decompose_tagmarkup�
calc_width�is_wide_char�move_prev_char�move_next_char)�calc_pos�calc_coords�
shift_line)�signals)�text_layout)�CanvasCache�CompositeCanvas�SolidCanvas�apply_text_layout)�command_map�CURSOR_LEFT�CURSOR_RIGHT� CURSOR_UP�CURSOR_DOWN�CURSOR_MAX_LEFT�CURSOR_MAX_RIGHT)�
split_repr�remove_defaults�python3_repr�flow�box�fixed�left�right�center�top�middle�bottom�space�any�clip�ellipsis�pack�given�relative�d �weightc s e Zd ZdZ� fdd�Z� ZS )�
WidgetMetaa�
Bases: :class:`MetaSuper`, :class:`MetaSignals`
Automatic caching of render and rows methods.
Class variable *no_cache* is a list of names of methods to not cache
automatically. Valid method names for *no_cache* are ``'render'`` and
``'rows'``.
Class variable *ignore_focus* if defined and set to ``True`` indicates
that the canvas this widget renders is not affected by the focus
parameter, so it may be ignored when caching.
c s� |� dg �}tt| ��|||� d|v r$d|vrt| �}nt| �}|| _d|v r1d|vr1t| �| _d|v r7| ` d|v r?| `
d S d S )N�no_cache�render�rows�ignore_focus)�get�superr2 �__init__�cache_widget_render�nocache_widget_renderr4 �cache_widget_rowsr5 r3 r6 )�cls�name�bases�dr3 � render_fn�� __class__� �./usr/lib/python3/dist-packages/urwid/widget.pyr9 V s
�zWidgetMeta.__init__)�__name__�
__module__�__qualname__�__doc__r9 �
__classcell__rD rD rB rE r2 H s
r2 c @ � e Zd ZdS )�WidgetErrorN�rF rG rH rD rD rD rE rL i � rL c C sd |r|dd� dkr|d |� � ks t|�dkr.|d |�� kr0td| |� � |�� |f ��dS dS )zA
Raise a WidgetError if a canv does not match size size.
� N)r r z8Widget %r rendered (%d x %d) canvas when passed size %r!)�cols�lenr5 rL )�widget�size�canvrD rD rE �
validate_sizel s $���rU c C sB z|j | _ | j�|j� |j| _|j| _W dS ty Y dS w )zN
Copy as much of the function detail from fn to new_fn
as we can.
N)rF �__dict__�updaterI rG � TypeError)�new_fn�fnrD rD rE �update_wrapperv s �r[ c s<