ok
Direktori : /opt/alt/python36/lib64/python3.6/idlelib/__pycache__/ |
Current File : //opt/alt/python36/lib64/python3.6/idlelib/__pycache__/browser.cpython-36.opt-1.pyc |
3 *j�aY � @ s� d Z ddlZddlmZ ddlZddlmZ ddlmZ ddl m Z mZmZ ddl mZ daddd �ZG d d� d�ZG dd � d e�ZG dd� de�Zdd� Zedkr�eej�dkr�ddlmZ edddd� ddlmZ ee� dS )a8 Module browser. XXX TO DO: - reparse when source changed (maybe just a button would be OK?) (or recheck on window popup) - add popup menu with more options (e.g. doc strings, base classes, imports) - add base classes to class browser tree - finish removing limitation to x.py files (ModuleBrowserTreeItem) � N)�_pyclbr)�idleConf)�pyshell)�TreeNode�TreeItem�ScrolledCanvas)�ListedToplevelc C s� g }x�| j � D ]�\}}|dks(|j|krt|d�r�|jr�|j|kr�g }xP|jD ]F}t|�td�krh|}n"|j}|j|jkr�|j� d|� �}|j|� qNW | jdjdj|��7 _|j|� qW t |dd� d �S ) a� Transform a child dictionary to an ordered sequence of objects. The dictionary maps names to pyclbr information objects. Filter out imported objects. Augment class names with bases. Sort objects by line number. The current tree only calls this once per child_dic as it saves TreeItems once created. A future tree and tests might violate this, so a check prevents multiple in-place augmentations. N�super� �.z({})z, c S s | j S )N)�lineno)�o� r �4/opt/alt/python36/lib64/python3.6/idlelib/browser.py�<lambda>6 s z$transform_children.<locals>.<lambda>)�key) �items�module�hasattrr �name�type�append�format�join�sorted)Z child_dict�modnameZobsr �objZsupersZsupZsnamer r r �transform_children s r c @ sB e Zd ZdZddd�dd�Zddd�Zd d � Zdd� Zd d� ZdS )� ModuleBrowserz1Browse module classes and functions in IDLE. F)�_htest�_utestc C s$ || _ || _|| _|| _| j� dS )az Create a window for browsing a module's structure. Args: master: parent for widgets. path: full path of file to browse. _htest - bool; change box location when running htest. -utest - bool; suppress contents when running unittest. Global variables: file_open: Function used for opening a file. Instance variables: name: Module name. file: Full path and module with .py extension. Used in creating ModuleBrowserTreeItem as the rootnode for the tree and subsequently in the children. N)�master�pathr r �init)�selfr! r"