Psyduck - 可達鴨 之 鴨力山大2


Server : LiteSpeed
System : Linux premium217.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User : alloknri ( 880)
PHP Version : 8.1.34
Disable Function : NONE
Directory :  /opt/alt/python33/lib64/python3.3/idlelib/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //opt/alt/python33/lib64/python3.3/idlelib/SearchDialog.py
from tkinter import *

from idlelib import SearchEngine
from idlelib.SearchDialogBase import SearchDialogBase

def _setup(text):
    root = text._root()
    engine = SearchEngine.get(root)
    if not hasattr(engine, "_searchdialog"):
        engine._searchdialog = SearchDialog(root, engine)
    return engine._searchdialog

def find(text):
    pat = text.get("sel.first", "sel.last")
    return _setup(text).open(text,pat)

def find_again(text):
    return _setup(text).find_again(text)

def find_selection(text):
    return _setup(text).find_selection(text)

class SearchDialog(SearchDialogBase):

    def create_widgets(self):
        f = SearchDialogBase.create_widgets(self)
        self.make_button("Find Next", self.default_command, 1)

    def default_command(self, event=None):
        if not self.engine.getprog():
            return
        self.find_again(self.text)

    def find_again(self, text):
        if not self.engine.getpat():
            self.open(text)
            return False
        if not self.engine.getprog():
            return False
        res = self.engine.search_text(text)
        if res:
            line, m = res
            i, j = m.span()
            first = "%d.%d" % (line, i)
            last = "%d.%d" % (line, j)
            try:
                selfirst = text.index("sel.first")
                sellast = text.index("sel.last")
                if selfirst == first and sellast == last:
                    text.bell()
                    return False
            except TclError:
                pass
            text.tag_remove("sel", "1.0", "end")
            text.tag_add("sel", first, last)
            text.mark_set("insert", self.engine.isback() and first or last)
            text.see("insert")
            return True
        else:
            text.bell()
            return False

    def find_selection(self, text):
        pat = text.get("sel.first", "sel.last")
        if pat:
            self.engine.setcookedpat(pat)
        return self.find_again(text)
Name
Size
Permissions
Options
Icons
--
drwxr-xr-x
__pycache__
--
drwxr-xr-x
idle_test
--
drwxr-xr-x
AutoComplete.py
8.869 KB
-rw-r--r--
AutoCompleteWindow.py
17.258 KB
-rw-r--r--
AutoExpand.py
2.425 KB
-rw-r--r--
Bindings.py
3.354 KB
-rw-r--r--
CREDITS.txt
1.821 KB
-rw-r--r--
CallTipWindow.py
5.761 KB
-rw-r--r--
CallTips.py
5.793 KB
-rw-r--r--
ChangeLog
55.071 KB
-rw-r--r--
ClassBrowser.py
6.222 KB
-rw-r--r--
CodeContext.py
8.157 KB
-rw-r--r--
ColorDelegator.py
10.222 KB
-rw-r--r--
Debugger.py
15.983 KB
-rw-r--r--
Delegator.py
0.649 KB
-rw-r--r--
EditorWindow.py
64.753 KB
-rw-r--r--
FileList.py
3.725 KB
-rw-r--r--
FormatParagraph.py
6.998 KB
-rw-r--r--
GrepDialog.py
4.015 KB
-rw-r--r--
HISTORY.txt
10.075 KB
-rw-r--r--
HyperParser.py
10.314 KB
-rw-r--r--
IOBinding.py
19.396 KB
-rw-r--r--
IdleHistory.py
4.021 KB
-rw-r--r--
MultiCall.py
17.118 KB
-rw-r--r--
MultiStatusBar.py
0.765 KB
-rw-r--r--
NEWS.txt
33.61 KB
-rw-r--r--
ObjectBrowser.py
3.661 KB
-rw-r--r--
OutputWindow.py
4.291 KB
-rw-r--r--
ParenMatch.py
6.472 KB
-rw-r--r--
PathBrowser.py
2.811 KB
-rw-r--r--
Percolator.py
2.596 KB
-rw-r--r--
PyParse.py
18.959 KB
-rw-r--r--
PyShell.py
56.521 KB
-rwxr-xr-x
README.txt
2.443 KB
-rw-r--r--
RemoteDebugger.py
11.747 KB
-rw-r--r--
RemoteObjectBrowser.py
0.941 KB
-rw-r--r--
ReplaceDialog.py
5.692 KB
-rw-r--r--
RstripExtension.py
1.025 KB
-rw-r--r--
ScriptBinding.py
7.88 KB
-rw-r--r--
ScrolledList.py
3.903 KB
-rw-r--r--
SearchDialog.py
1.969 KB
-rw-r--r--
SearchDialogBase.py
5.063 KB
-rw-r--r--
SearchEngine.py
7.367 KB
-rw-r--r--
StackViewer.py
3.483 KB
-rw-r--r--
TODO.txt
8.279 KB
-rw-r--r--
ToolTip.py
2.672 KB
-rw-r--r--
TreeWidget.py
14.863 KB
-rw-r--r--
UndoDelegator.py
10.063 KB
-rw-r--r--
WidgetRedirector.py
4.372 KB
-rw-r--r--
WindowList.py
2.414 KB
-rw-r--r--
ZoomHeight.py
1.276 KB
-rw-r--r--
__init__.py
0.036 KB
-rw-r--r--
__main__.py
0.106 KB
-rw-r--r--
aboutDialog.py
6.421 KB
-rw-r--r--
config-extensions.def
2.723 KB
-rw-r--r--
config-highlight.def
1.699 KB
-rw-r--r--
config-keys.def
7.348 KB
-rw-r--r--
config-main.def
2.455 KB
-rw-r--r--
configDialog.py
51.611 KB
-rw-r--r--
configHandler.py
28.636 KB
-rw-r--r--
configHelpSourceEdit.py
6.567 KB
-rw-r--r--
configSectionNameDialog.py
4.213 KB
-rw-r--r--
dynOptionMenuWidget.py
1.277 KB
-rw-r--r--
extend.txt
3.557 KB
-rw-r--r--
help.txt
11.713 KB
-rw-r--r--
idle.py
0.391 KB
-rw-r--r--
idle.pyw
0.655 KB
-rw-r--r--
idlever.py
0.022 KB
-rw-r--r--
keybindingDialog.py
12.136 KB
-rw-r--r--
macosxSupport.py
7.004 KB
-rw-r--r--
rpc.py
20.462 KB
-rw-r--r--
run.py
13.373 KB
-rw-r--r--
tabbedpages.py
17.741 KB
-rw-r--r--
textView.py
3.462 KB
-rw-r--r--