small change
This commit is contained in:
parent
cbb0d5255b
commit
ab631c73dd
@ -39,9 +39,9 @@ EXIT_COMMANDS = {
|
|||||||
|
|
||||||
|
|
||||||
def cli():
|
def cli():
|
||||||
def next_search(search: pages.Search, query: str) -> bool:
|
def next_search(_search: pages.Search, query: str) -> bool:
|
||||||
"""
|
"""
|
||||||
:param search:
|
:param _search:
|
||||||
:param query:
|
:param query:
|
||||||
:return exit in the next step:
|
:return exit in the next step:
|
||||||
"""
|
"""
|
||||||
@ -54,15 +54,15 @@ def cli():
|
|||||||
if parsed == ".":
|
if parsed == ".":
|
||||||
return False
|
return False
|
||||||
if parsed == "..":
|
if parsed == "..":
|
||||||
search.goto_previous()
|
_search.goto_previous()
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if parsed.isdigit():
|
if parsed.isdigit():
|
||||||
search.choose_index(int(parsed))
|
_search.choose_index(int(parsed))
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if parsed in DOWNLOAD_COMMANDS:
|
if parsed in DOWNLOAD_COMMANDS:
|
||||||
r = search.download_chosen()
|
r = _search.download_chosen()
|
||||||
|
|
||||||
print()
|
print()
|
||||||
print(r)
|
print(r)
|
||||||
@ -72,17 +72,17 @@ def cli():
|
|||||||
|
|
||||||
url = re.match(URL_REGGEX, query)
|
url = re.match(URL_REGGEX, query)
|
||||||
if url is not None:
|
if url is not None:
|
||||||
if not search.search_url(url.string):
|
if not _search.search_url(url.string):
|
||||||
print("The given url couldn't be found.")
|
print("The given url couldn't be found.")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
page = search.get_page_from_query(parsed)
|
page = _search.get_page_from_query(parsed)
|
||||||
if page is not None:
|
if page is not None:
|
||||||
search.choose_page(page)
|
_search.choose_page(page)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# if everything else is not valid search
|
# if everything else is not valid search
|
||||||
search.search(query)
|
_search.search(query)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
search = pages.Search()
|
search = pages.Search()
|
||||||
|
Loading…
Reference in New Issue
Block a user