fix: f-string; return None for Kali, NixOS rel_ver
This commit is contained in:
parent
8673778501
commit
6bfe0ee048
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
||||
.venv
|
||||
dist
|
||||
uv.lock
|
||||
|
@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "qbt-helper"
|
||||
version = "0.2"
|
||||
version = "0.3"
|
||||
authors = [
|
||||
{ name="Jeffrey Serio", email="hyperreal@fedoraproject.org" },
|
||||
]
|
||||
|
@ -57,10 +57,12 @@ def get_torrents_from_html(webpage_url: str, torrent_substring: str) -> list:
|
||||
urls = []
|
||||
for link in soup.find_all("a"):
|
||||
if torrent_substring in link.get("href"):
|
||||
url = f"{webpage_url}/{link.get("href")}"
|
||||
url = f"{webpage_url}/{link.get('href')}"
|
||||
response = requests.get(url)
|
||||
if response.status_code == 200:
|
||||
urls.append(url)
|
||||
else:
|
||||
exit(f"Error verifying the URL: {url}")
|
||||
|
||||
return urls
|
||||
|
||||
@ -276,7 +278,10 @@ def get_tails_urls(rel_ver: str):
|
||||
|
||||
def selection_prompt(distro_selection: str) -> tuple:
|
||||
choice = Prompt.ask("Enter 'a' to add; 'r' to remove.")
|
||||
if distro_selection != "Kali Linux" and distro_selection != "NixOS":
|
||||
rel_ver = Prompt.ask(f"Enter a release version for {distro_selection}")
|
||||
else:
|
||||
rel_ver = None
|
||||
return (choice, rel_ver)
|
||||
|
||||
|
||||
@ -371,7 +376,7 @@ def main():
|
||||
case "Kali Linux":
|
||||
match action[0]:
|
||||
case "a":
|
||||
add_torrents(get_kali_urls(action[1]), conn_info)
|
||||
add_torrents(get_kali_urls(), conn_info)
|
||||
case "r":
|
||||
remove_torrents("kali-linux", conn_info)
|
||||
case _:
|
||||
|
Loading…
x
Reference in New Issue
Block a user