コード例 #1
0
 def open(self, text, searchphrase, io=None):
     SearchDialogBase.open(self, text, searchphrase)
     if io:
         path = io.filename or ""
     else:
         path = ""
     dir, base = os.path.split(path)
     head, tail = os.path.splitext(base)
     if not tail:
         tail = ".py"
     self.globvar.set(os.path.join(dir, "*" + tail))
コード例 #2
0
ファイル: grep.py プロジェクト: JSMSC/cpython
 def open(self, text, searchphrase, io=None):
     SearchDialogBase.open(self, text, searchphrase)
     if io:
         path = io.filename or ""
     else:
         path = ""
     dir, base = os.path.split(path)
     head, tail = os.path.splitext(base)
     if not tail:
         tail = ".py"
     self.globvar.set(os.path.join(dir, "*" + tail))
コード例 #3
0
 def open(self, text, searchphrase, io=None):
     SearchDialogBase.open(self, text, searchphrase)
     if io:
         path = io.filename or ''
     else:
         path = ''
     dir, base = os.path.split(path)
     head, tail = os.path.splitext(base)
     if not tail:
         tail = '.py'
     self.globvar.set(os.path.join(dir, '*' + tail))
コード例 #4
0
    def create_command_buttons(self):
        """Create base and additional command buttons.

        The additional buttons are for Find, Replace,
        Replace+Find, and Replace All.
        """
        SearchDialogBase.create_command_buttons(self)
        self.make_button("Find", self.find_it)
        self.make_button("Replace", self.replace_it)
        self.make_button("Replace+Find", self.default_command, isdef=True)
        self.make_button("Replace All", self.replace_all)
コード例 #5
0
ファイル: replace.py プロジェクト: willingc/cpython
    def create_command_buttons(self):
        """Create base and additional command buttons.

        The additional buttons are for Find, Replace,
        Replace+Find, and Replace All.
        """
        SearchDialogBase.create_command_buttons(self)
        self.make_button("Find", self.find_it)
        self.make_button("Replace", self.replace_it)
        self.make_button("Replace+Find", self.default_command, isdef=True)
        self.make_button("Replace All", self.replace_all)
コード例 #6
0
 def open(self, text, searchphrase, io=None):
     "Make dialog visible on top of others and ready to use."
     SearchDialogBase.open(self, text, searchphrase)
     if io:
         path = io.filename or ""
     else:
         path = ""
     dir, base = os.path.split(path)
     head, tail = os.path.splitext(base)
     if not tail:
         tail = ".py"
     self.globvar.set(os.path.join(dir, "*" + tail))
コード例 #7
0
 def open(self, text, *args):
     SearchDialogBase.open(self, text)
     try:
         first = text.index("sel.first")
     except TclError:
         first = None
     try:
         last = text.index("sel.last")
     except TclError:
         last = None
     first = first or text.index("insert")
     last = last or last
     self.show_hit(first, last)
     self.ok = 1
コード例 #8
0
ファイル: replace.py プロジェクト: Darkness0ut/cpython
 def open(self, text):
     """Display the replace dialog"""
     SearchDialogBase.open(self, text)
     try:
         first = text.index("sel.first")
     except TclError:
         first = None
     try:
         last = text.index("sel.last")
     except TclError:
         last = None
     first = first or text.index("insert")
     last = last or first
     self.show_hit(first, last)
     self.ok = 1
コード例 #9
0
ファイル: replace.py プロジェクト: iflat/idlecn
 def open(self, text):
     """Display the replace dialog"""
     SearchDialogBase.open(self, text)
     try:
         first = text.index("sel.first")
     except TclError:
         first = None
     try:
         last = text.index("sel.last")
     except TclError:
         last = None
     first = first or text.index("insert")
     last = last or first
     self.show_hit(first, last)
     self.ok = 1
コード例 #10
0
    def __init__(self, root, engine, flist):
        """Create search dialog for searching for a phrase in the file system.

        Uses SearchDialogBase as the basis for the GUI and a
        searchengine instance to prepare the search.

        Attributes:
            globvar: Value of Text Entry widget for path to search.
            recvar: Boolean value of Checkbutton widget
                    for traversing through subdirectories.
        """
        SearchDialogBase.__init__(self, root, engine)
        self.flist = flist
        self.globvar = StringVar(root)
        self.recvar = BooleanVar(root)
コード例 #11
0
ファイル: grep.py プロジェクト: zhangzhao2014/cpython
    def open(self, text, searchphrase, io=None):
        """Make dialog visible on top of others and ready to use.

        Extend the SearchDialogBase open() to set the initial value
        for globvar.

        Args:
            text: Multicall object containing the text information.
            searchphrase: String phrase to search.
            io: iomenu.IOBinding instance containing file path.
        """
        SearchDialogBase.open(self, text, searchphrase)
        if io:
            path = io.filename or ""
        else:
            path = ""
        dir, base = os.path.split(path)
        head, tail = os.path.splitext(base)
        if not tail:
            tail = ".py"
        self.globvar.set(os.path.join(dir, "*" + tail))
コード例 #12
0
ファイル: replace.py プロジェクト: willingc/cpython
    def open(self, text):
        """Make dialog visible on top of others and ready to use.

        Also, highlight the currently selected text and set the
        search to include the current selection (self.ok).

        Args:
            text: Text widget being searched.
        """
        SearchDialogBase.open(self, text)
        try:
            first = text.index("sel.first")
        except TclError:
            first = None
        try:
            last = text.index("sel.last")
        except TclError:
            last = None
        first = first or text.index("insert")
        last = last or first
        self.show_hit(first, last)
        self.ok = True
コード例 #13
0
    def open(self, text):
        """Make dialog visible on top of others and ready to use.

        Also, highlight the currently selected text and set the
        search to include the current selection (self.ok).

        Args:
            text: Text widget being searched.
        """
        SearchDialogBase.open(self, text)
        try:
            first = text.index("sel.first")
        except TclError:
            first = None
        try:
            last = text.index("sel.last")
        except TclError:
            last = None
        first = first or text.index("insert")
        last = last or first
        self.show_hit(first, last)
        self.ok = True
コード例 #14
0
ファイル: replace.py プロジェクト: iflat/idlecn
 def create_entries(self):
     """Create label and text entry widgets"""
     SearchDialogBase.create_entries(self)
     self.replent = self.make_entry("替换为:", self.replvar)[0]
コード例 #15
0
ファイル: replace.py プロジェクト: willingc/cpython
 def close(self, event=None):
     "Close the dialog and remove hit tags."
     SearchDialogBase.close(self, event)
     self.text.tag_remove("hit", "1.0", "end")
コード例 #16
0
ファイル: replace.py プロジェクト: iflat/idlecn
 def __init__(self, root, engine):
     SearchDialogBase.__init__(self, root, engine)
     self.replvar = StringVar(root)
コード例 #17
0
ファイル: replace.py プロジェクト: iflat/idlecn
 def close(self, event=None):
     SearchDialogBase.close(self, event)
     self.text.tag_remove("hit", "1.0", "end")
コード例 #18
0
 def create_entries(self, *args):
     SearchDialogBase.create_entries(self)
     self.replent = self.make_entry("Replace With:", self.replvar)[0]
コード例 #19
0
ファイル: grep.py プロジェクト: JSMSC/cpython
 def create_entries(self):
     SearchDialogBase.create_entries(self)
     self.globent = self.make_entry("In files:", self.globvar)[0]
コード例 #20
0
ファイル: replace.py プロジェクト: Darkness0ut/cpython
 def __init__(self, root, engine):
     SearchDialogBase.__init__(self, root, engine)
     self.replvar = StringVar(root)
コード例 #21
0
ファイル: replace.py プロジェクト: willingc/cpython
 def create_entries(self):
     "Create base and additional label and text entry widgets."
     SearchDialogBase.create_entries(self)
     self.replent = self.make_entry("Replace with:", self.replvar)[0]
コード例 #22
0
 def create_command_buttons(self):
     SearchDialogBase.create_command_buttons(self)
     self.make_button("Search Files", self.default_command, 1)
コード例 #23
0
ファイル: grep.py プロジェクト: JSMSC/cpython
 def __init__(self, root, engine, flist):
     SearchDialogBase.__init__(self, root, engine)
     self.flist = flist
     self.globvar = StringVar(root)
     self.recvar = BooleanVar(root)
コード例 #24
0
ファイル: search.py プロジェクト: JasonZhou0/CM01
 def create_widgets(self):
     SearchDialogBase.create_widgets(self)
     self.make_button("Find Next", self.default_command, 1)
コード例 #25
0
ファイル: replace.py プロジェクト: Darkness0ut/cpython
 def create_entries(self):
     """Create label and text entry widgets"""
     SearchDialogBase.create_entries(self)
     self.replent = self.make_entry("Replace with:", self.replvar)[0]
コード例 #26
0
ファイル: replace.py プロジェクト: zwm/cpython
 def create_command_buttons(self):
     SearchDialogBase.create_command_buttons(self)
     self.make_button("Find", self.find_it)
     self.make_button("Replace", self.replace_it)
     self.make_button("Replace+Find", self.default_command, 1)
     self.make_button("Replace All", self.replace_all)
コード例 #27
0
ファイル: grep.py プロジェクト: JSMSC/cpython
 def create_command_buttons(self):
     SearchDialogBase.create_command_buttons(self)
     self.make_button("Search Files", self.default_command, 1)
コード例 #28
0
ファイル: replace.py プロジェクト: iflat/idlecn
 def create_command_buttons(self):
     SearchDialogBase.create_command_buttons(self)
     self.make_button("查找", self.find_it)
     self.make_button("替换", self.replace_it)
     self.make_button("查找并替换", self.default_command, 1)
     self.make_button("全部替换", self.replace_all)
コード例 #29
0
ファイル: replace.py プロジェクト: Darkness0ut/cpython
 def close(self, event=None):
     SearchDialogBase.close(self, event)
     self.text.tag_remove("hit", "1.0", "end")
コード例 #30
0
 def create_entries(self):
     "Create base and additional label and text entry widgets."
     SearchDialogBase.create_entries(self)
     self.replent = self.make_entry("Replace with:", self.replvar)[0]
コード例 #31
0
ファイル: replace.py プロジェクト: emilyemorehouse/ast-and-me
 def close(self, event=None):
     SearchDialogBase.close(self, event)
     self.text.tag_remove('hit', '1.0', 'end')
コード例 #32
0
ファイル: search.py プロジェクト: 1st1/cpython
 def create_widgets(self):
     SearchDialogBase.create_widgets(self)
     self.make_button("Find Next", self.default_command, 1)
コード例 #33
0
ファイル: replace.py プロジェクト: Darkness0ut/cpython
 def create_command_buttons(self):
     SearchDialogBase.create_command_buttons(self)
     self.make_button("Find", self.find_it)
     self.make_button("Replace", self.replace_it)
     self.make_button("Replace+Find", self.default_command, 1)
     self.make_button("Replace All", self.replace_all)
コード例 #34
0
 def create_entries(self):
     "Create base entry widgets and add widget for search path."
     SearchDialogBase.create_entries(self)
     self.globent = self.make_entry("In files:", self.globvar)[0]
コード例 #35
0
 def __init__(self, root, engine, flist):
     SearchDialogBase.__init__(self, root, engine)
     self.flist = flist
     self.globvar = StringVar(root)
     self.recvar = BooleanVar(root)
コード例 #36
0
 def create_command_buttons(self):
     "Create base command buttons and add button for search."
     SearchDialogBase.create_command_buttons(self)
     self.make_button("Search Files", self.default_command, 1)
コード例 #37
0
 def create_entries(self):
     SearchDialogBase.create_entries(self)
     self.globent = self.make_entry("In files:", self.globvar)[0]
コード例 #38
0
 def close(self, event=None):
     "Close the dialog and remove hit tags."
     SearchDialogBase.close(self, event)
     self.text.tag_remove("hit", "1.0", "end")
コード例 #39
0
ファイル: search.py プロジェクト: BingoTop/Bookmark
 def create_widgets(self):
     "Create the base search dialog and add a button for Find Next."
     SearchDialogBase.create_widgets(self)
     # TODO - why is this here and not in a create_command_buttons?
     self.make_button("Find Next", self.default_command, isdef=True)
コード例 #40
0
ファイル: search.py プロジェクト: willingc/cpython
 def create_widgets(self):
     "Create the base search dialog and add a button for Find Next."
     SearchDialogBase.create_widgets(self)
     # TODO - why is this here and not in a create_command_buttons?
     self.make_button("Find Next", self.default_command, isdef=True)