Regular expressions in downloading files.

This commit is contained in:
Victorious Children Studios 2023-12-21 23:20:12 +02:00
parent 847c72a388
commit cb7e89be29

View file

@ -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,14 +805,23 @@ 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():
searchtext = win.text["http_client_search"]["text"]
rthings = "[]*?!"
found = False
continue
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"