HEX

Warning: set_time_limit() [function.set-time-limit]: Cannot set time limit - prohibited by configuration in /home/u547966/brikov.ru/www/wp-content/plugins/admin-menu-editor/menu-editor.php on line 745
Server: Apache
System: Linux 4.19.0-0.bpo.9-amd64 x86_64 at red40
User: u547966 (5490)
PHP: 5.3.29-mh2
Disabled: syslog, dl, popen, proc_open, proc_nice, proc_get_status, proc_close, proc_terminate, posix_mkfifo, chown, chgrp, accelerator_reset, opcache_reset, accelerator_get_status, opcache_get_status, pcntl_alarm, pcntl_fork, pcntl_waitpid, pcntl_wait, pcntl_wifexited, pcntl_wifstopped, pcntl_wifsignaled, pcntl_wifcontinued, pcntl_wexitstatus, pcntl_wtermsig, pcntl_wstopsig, pcntl_signal, pcntl_signal_dispatch, pcntl_get_last_error, pcntl_strerror, pcntl_sigprocmask, pcntl_sigwaitinfo, pcntl_sigtimedwait, pcntl_exec, pcntl_getpriority, pcntl_setpriority
Upload Files
File: //usr/lib/python3.5/idlelib/__pycache__/SearchDialogBase.cpython-35.pyc


Füƒaaã@s|dZddlmZmZmZmZmZmZmZGdd„dƒZ	e
dkrxddlZejddd	ƒdS)
zBDefine SearchDialogBase used by Search, Replace, and Grep dialogs.é)ÚToplevelÚFrameÚEntryÚLabelÚButtonÚCheckbuttonÚRadiobuttonc@s¸eZdZdZdZdZdZdd„Zddd	„Zdd
d„Z	dd
„Z
dd„Zdd„Zddd„Z
dd„Zdd„Zddd„Zdd„ZdS)ÚSearchDialogBaseayCreate most of a 3 or 4 row, 3 column search dialog.

    The left and wide middle column contain:
    1 or 2 labeled text entry lines (make_entry, create_entries);
    a row of standard Checkbuttons (make_frame, create_option_buttons),
    each of which corresponds to a search engine Variable;
    a row of dialog-specific Check/Radiobuttons (create_other_buttons).

    The narrow right column contains command buttons
    (make_button, create_command_buttons).
    These are bound to functions that execute the command.

    Except for command buttons, this base class is not limited to items
    common to all three subclasses.  Rather, it is the Find dialog minus
    the "Find Next" command, its execution function, and the
    default_command attribute needed in create_widgets. The other
    dialogs override attributes and methods, the latter to replace and
    add widgets.
    z
Search DialogZSearchécCs||_||_d|_dS)a'Initialize root, engine, and top attributes.

        top (level widget): set in create_widgets() called from open().
        text (Text searched): set in open(), only used in subclasses().
        ent (ry): created in make_entry() called from create_entry().
        row (of grid): 0 in create_widgets(), +1 in make_entry/frame().
        default_command: set in subclasses, used in create_widgers().

        title (of dialog): class attribute, override in subclasses.
        icon (of dialog): ditto, use unclear if cannot minimize dialog.
        N)ÚrootÚengineÚtop)Úselfrr©rú./usr/lib/python3.5/idlelib/SearchDialogBase.pyÚ__init__s		zSearchDialogBase.__init__NcCs¦||_|js|jƒn|jjƒ|jjƒ|re|jjddƒ|jjd|ƒ|jjƒ|jj	ddƒ|jj
dƒ|jjƒdS)z6Make dialog visible on top of others and ready to use.rÚendN)Útextr
Úcreate_widgetsZ	deiconifyZtkraiseÚentZdeleteÚinsertZ	focus_setZselection_rangeZicursorZgrab_set)rrZsearchphraserrrÚopen/s		



zSearchDialogBase.opencCs'|jr#|jjƒ|jjƒdS)zPut dialog away for later use.N)r
Zgrab_releaseZwithdraw)rZeventrrrÚclose?s	
zSearchDialogBase.closecCsät|jƒ}|jd|jƒ|jd|jƒ|jd|jƒ|j|jƒ|j|j	ƒ||_
d|_|j
jdddddƒ|j
jdddd	d
dd
ƒ|j
ƒ|jƒ|jƒ|jƒdS)z¹Create basic 3 row x 3 col search (find) dialog.

        Other dialogs override subsidiary create_x methods as needed.
        Replace and Find-in-Files add another entry row.
        z<Return>z<Escape>ZWM_DELETE_WINDOWrZpadéZweightr
ZminsizeédN)rrZbindZdefault_commandrZprotocolZwm_titleÚtitleZwm_iconnameÚiconr
ÚrowZgrid_columnconfigureÚcreate_entriesÚcreate_option_buttonsÚcreate_other_buttonsÚcreate_command_buttons)rr
rrrrEs		"


zSearchDialogBase.create_widgetscCsˆt|jd|ƒ}|jd|jddddƒt|jd|ddƒ}|jd|jdd	dd
ƒ|jd	|_||fS)zŒReturn (entry, label), .

        entry - gridded labeled Entry for text entry.
        label - Label widget, returned for testing.
        rrÚcolumnrÚstickyÚnwZtextvariableZexportselectionr
Únwe)rr
Úgridrr)rZ
label_textÚvarÚlabelÚentryrrrÚ
make_entry\szSearchDialogBase.make_entrycCs#|jd|jjƒd|_dS)z/Create one or more entry lines with make_entry.zFind:rN)r*rZpatvarr)rrrrriszSearchDialogBase.create_entriesc	Cs‘|r=t|jd|ƒ}|jd|jddddƒnd}t|jƒ}|jd|jddd	ddd
ƒ|jd|_||fS)z—Return (frame, label).

        frame - gridded labeled Frame for option or other buttons.
        label - Label widget, returned for testing.
        rrr"rr#r$Úr
Z
columnspanr%)rr
r&rr)rZ	labeltextr(ÚframerrrÚ
make_framems"%zSearchDialogBase.make_framec	CsÐ|jdƒd}|j}|jdf|jdf|jdfg}|jre|j|jdfƒx^|D]V\}}t|ddd	|d
|ƒ}|j	ddd
dƒ|j
ƒrl|jƒqlW||fS)aReturn (filled frame, options) for testing.

        Options is a list of SearchEngine booleanvar, label pairs.
        A gridded frame from make_frame is filled with a Checkbutton
        for each pair, bound to the var, with the corresponding label.
        ZOptionsrzRegular expressionz
Match casez
Whole wordzWrap aroundÚanchorÚwÚvariablerÚsideÚleftÚfillÚboth)r-rZrevarZcasevarZwordvarÚneedwrapbuttonÚappendZwrapvarrÚpackÚgetÚselect)rr,rZoptionsr'r(Úbtnrrrr}s		z&SearchDialogBase.create_option_buttonscCs¢|jdƒd}|jj}ddg}xj|D]b\}}t|ddd|d	|d
|ƒ}|jddd
dƒ|jƒ|kr2|jƒq2W||fS)z£Return (frame, others) for testing.

        Others is a list of value, label pairs.
        A gridded frame from make_frame is filled with radio buttons.
        Z	Directionrr
ÚUpÚDownr.r/r0Úvaluerr1r2r3r4)r
r;)rr<)r-rZbackvarrr7r8r9)rr,r'ZothersÚvalr(r:rrrr ’sz%SearchDialogBase.create_other_buttonsrc	Cst|jd|d|d|r$dp'dƒ}|jjƒ\}}|jddd|d	d
ddƒ|jjd
|dƒ|S)z/Return command button gridded in command frame.rÚcommandÚdefaultZactiveZnormalÚpadyr
rr"rr#ZewZrowspan)rÚbuttonframeZ	grid_sizer&)rr(r?ZisdefÚbZcolsZrowsrrrÚmake_button£s"zSearchDialogBase.make_buttonc
Csgt|jƒ}|_|jddddddddddddƒ|jd	|jƒ}|jƒd
S)z9Place buttons in vertical command frame gridded on right.rrr"rZpadxrAZipadxZipadyrN)rr
rBr&rDrÚlower)rÚfrCrrrr!­s.z'SearchDialogBase.create_command_buttons)Ú__name__Ú
__module__Ú__qualname__Ú__doc__rrr5rrrrr*rr-rr rDr!rrrrr	s

r	Ú__main__Nz'idlelib.idle_test.test_searchdialogbaseÚ	verbosityr)
rJZtkinterrrrrrrrr	rGZunittestÚmainrrrrÚ<module>s4¯