本文整理汇总了Python中Search.filter_out方法的典型用法代码示例。如果您正苦于以下问题:Python Search.filter_out方法的具体用法?Python Search.filter_out怎么用?Python Search.filter_out使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Search
的用法示例。
在下文中一共展示了Search.filter_out方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: fillSearchBox
# 需要导入模块: import Search [as 别名]
# 或者: from Search import filter_out [as 别名]
def fillSearchBox(fltr, key):
global channels
global searchPos
global main_window
global list_win
max_row = list_win.getmaxyx()[0] - 2
filtered = Search.filter_out(fltr, channels)
if (len(filtered) - 1) < max_row:
max_row = len(filtered) + 1
if key == 0 and searchPos >= 2:
searchPos -= 1
if key == 1 and searchPos < max_row:
searchPos += 1
if searchPos > max_row - 1:
searchPos = max_row - 1
clearListWin(Strings.search_bx)
for i in range(1, max_row):
channel = filtered[i - 1]
outstr = getRowText(channel)
if (i == searchPos):
list_win.addstr(i, 1, outstr, curses.A_REVERSE)
else:
list_win.addstr(i, 1, outstr)
list_win.refresh()
示例2: getSelectedRow
# 需要导入模块: import Search [as 别名]
# 或者: from Search import filter_out [as 别名]
def getSelectedRow():
global channels
if Search.text == "":
return channels[curPos]
else:
return Search.filter_out(Search.text, channels)[searchPos]