当前位置: 首页>>代码示例>>Python>>正文


Python searchbase.SearchDialogBase类代码示例

本文整理汇总了Python中idlelib.searchbase.SearchDialogBase的典型用法代码示例。如果您正苦于以下问题:Python SearchDialogBase类的具体用法?Python SearchDialogBase怎么用?Python SearchDialogBase使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了SearchDialogBase类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: open

 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))
开发者ID:JSMSC,项目名称:cpython,代码行数:11,代码来源:grep.py

示例2: create_command_buttons

    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)
开发者ID:willingc,项目名称:cpython,代码行数:11,代码来源:replace.py

示例3: open

 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))
开发者ID:1st1,项目名称:cpython,代码行数:12,代码来源:grep.py

示例4: __init__

    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)
开发者ID:1st1,项目名称:cpython,代码行数:15,代码来源:grep.py

示例5: open

 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
开发者ID:Darkness0ut,项目名称:cpython,代码行数:15,代码来源:replace.py

示例6: open

    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
开发者ID:willingc,项目名称:cpython,代码行数:22,代码来源:replace.py

示例7: close

 def close(self, event=None):
     SearchDialogBase.close(self, event)
     self.text.tag_remove("hit", "1.0", "end")
开发者ID:Darkness0ut,项目名称:cpython,代码行数:3,代码来源:replace.py

示例8: create_command_buttons

 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)
开发者ID:1st1,项目名称:cpython,代码行数:4,代码来源:grep.py

示例9: create_entries

 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]
开发者ID:1st1,项目名称:cpython,代码行数:4,代码来源:grep.py

示例10: create_widgets

 def create_widgets(self):
     SearchDialogBase.create_widgets(self)
     self.make_button("Find Next", self.default_command, 1)
开发者ID:1st1,项目名称:cpython,代码行数:3,代码来源:search.py

示例11: create_entries

 def create_entries(self):
     """Create label and text entry widgets"""
     SearchDialogBase.create_entries(self)
     self.replent = self.make_entry("Replace with:", self.replvar)[0]
开发者ID:Darkness0ut,项目名称:cpython,代码行数:4,代码来源:replace.py

示例12: __init__

 def __init__(self, root, engine, flist):
     SearchDialogBase.__init__(self, root, engine)
     self.flist = flist
     self.globvar = StringVar(root)
     self.recvar = BooleanVar(root)
开发者ID:JSMSC,项目名称:cpython,代码行数:5,代码来源:grep.py

示例13: create_entries

 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]
开发者ID:willingc,项目名称:cpython,代码行数:4,代码来源:replace.py

示例14: close

 def close(self, event=None):
     "Close the dialog and remove hit tags."
     SearchDialogBase.close(self, event)
     self.text.tag_remove("hit", "1.0", "end")
开发者ID:willingc,项目名称:cpython,代码行数:4,代码来源:replace.py

示例15: __init__

 def __init__(self, root, engine):
     SearchDialogBase.__init__(self, root, engine)
     self.replvar = StringVar(root)
开发者ID:Darkness0ut,项目名称:cpython,代码行数:3,代码来源:replace.py


注:本文中的idlelib.searchbase.SearchDialogBase类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。