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"]
|
ActiveTab = win.current["remote-folder-data"][cur]["active_tab"]
|
||||||
DisplayList = win.current["remote-folder-data"][cur][ActiveTab]
|
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:
|
try:
|
||||||
for f in DisplayList:
|
for f in DisplayList:
|
||||||
|
|
||||||
|
@ -802,15 +805,24 @@ def prompt_layer(win, call):
|
||||||
if fdata.get("finished"):
|
if fdata.get("finished"):
|
||||||
continue
|
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"]:
|
if win.text["http_client_search"]["text"]:
|
||||||
for word in win.text["http_client_search"]["text"].split(" "):
|
searchtext = win.text["http_client_search"]["text"]
|
||||||
if word.lower() not in f.lower():
|
rthings = "[]*?!"
|
||||||
found = False
|
found = False
|
||||||
continue
|
for thing in rthings:
|
||||||
|
if thing in searchtext:
|
||||||
if not found:
|
found = True
|
||||||
continue
|
break
|
||||||
|
if not found:
|
||||||
|
searchtext = "*"+searchtext+"*"
|
||||||
|
if not fnmatch.fnmatch(f, searchtext):
|
||||||
|
continue
|
||||||
|
|
||||||
ticon = "unchecked"
|
ticon = "unchecked"
|
||||||
if fdata.get("to_download", True):
|
if fdata.get("to_download", True):
|
||||||
|
|
Loading…
Add table
Reference in a new issue