diff --git a/network/http_client.py b/network/http_client.py index b1539b0..7d396dc 100644 --- a/network/http_client.py +++ b/network/http_client.py @@ -794,6 +794,9 @@ def prompt_layer(win, call): ActiveTab = win.current["remote-folder-data"][cur]["active_tab"] DisplayList = win.current["remote-folder-data"][cur][ActiveTab] + # if win.text["http_client_search"]["text"]: + # DisplayList = fnmatch.filter(DisplayList, win.text["http_client_search"]["text"]) + try: for f in DisplayList: @@ -802,15 +805,24 @@ def prompt_layer(win, call): if fdata.get("finished"): continue - found = True + # found = True + # if win.text["http_client_search"]["text"]: + # for word in win.text["http_client_search"]["text"].split(" "): + # if word.lower() not in f.lower(): + # found = False + # continue if win.text["http_client_search"]["text"]: - for word in win.text["http_client_search"]["text"].split(" "): - if word.lower() not in f.lower(): - found = False - continue - - if not found: - continue + searchtext = win.text["http_client_search"]["text"] + rthings = "[]*?!" + found = False + for thing in rthings: + if thing in searchtext: + found = True + break + if not found: + searchtext = "*"+searchtext+"*" + if not fnmatch.fnmatch(f, searchtext): + continue ticon = "unchecked" if fdata.get("to_download", True):