本文整理匯總了Python中control.Control.get_last_regex方法的典型用法代碼示例。如果您正苦於以下問題:Python Control.get_last_regex方法的具體用法?Python Control.get_last_regex怎麽用?Python Control.get_last_regex使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類control.Control
的用法示例。
在下文中一共展示了Control.get_last_regex方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: event_switch_to_list_view
# 需要導入模塊: from control import Control [as 別名]
# 或者: from control.Control import get_last_regex [as 別名]
def event_switch_to_list_view(self, widget, event, data=None):
TixMode.current = TixMode.LIST
self.status_bar.update("- Search: %s" % Control.get_last_regex() if Control.get_last_regex() else "")
if Control.reload_notes:
self.stored_items.load(self.notes_root, self.recursive)
self.create_list()
Control.reload_notes = False
self.vbox.remove(self.editor.get_parent())
self.vbox.pack_start(self.commandline, False, False, 0)
self.vbox.add(self.tree_view.get_parent())
self.tree_view.grab_focus()
self.main_window.show_all()
示例2: filter
# 需要導入模塊: from control import Control [as 別名]
# 或者: from control.Control import get_last_regex [as 別名]
def filter(self, function_while_processing=None):
from control import Control
list_modes = self.modes()
current_mode = list_modes[UserMode.current]
nbr_visible = 0
for i, note in enumerate(self.list):
if not note.is_processed: note.process_meta(i)
if (current_mode == UserMode.ALL or current_mode in note.modes) \
and note.is_search_match(Control.get_last_regex()):
note.visible(True)
nbr_visible += 1
else:
note.visible(False)
if function_while_processing and i % 100 == 0:
function_while_processing()
return nbr_visible
示例3: f
# 需要導入模塊: from control import Control [as 別名]
# 或者: from control.Control import get_last_regex [as 別名]
def f(sofar, m):
regex = Control.get_last_regex()
if regex and utils.search_regex(regex, m):
return "%s<span background='#ee6' color='#000'> %s </span> " % (sofar, m)
else:
return "%s<span background='#d0ddef' color='#024'> %s </span> " % (sofar, m)