Regular expressions in downloading files.
This commit is contained in:
parent
847c72a388
commit
cb7e89be29
1 changed files with 20 additions and 8 deletions
|
@ -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):
|
||||
|
|
Loading…
Reference in a new issue