本文整理匯總了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]