Skip to content

Commit f6421d7

Browse files
committed
Add a bit more default pictures for steps
1 parent c5b6656 commit f6421d7

6 files changed

Lines changed: 12 additions & 7 deletions

File tree

8.79 KB
Loading
8.13 KB
Loading

openandroidinstaller/installer_config.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,27 @@
2323

2424

2525
class Step:
26+
"""Class representing on step in the installer."""
27+
28+
default_images = {
29+
"Unlock the bootloader": "unlock-bootloader-default.png",
30+
}
31+
2632
def __init__(
2733
self,
2834
title: str,
2935
type: str,
3036
content: str,
3137
command: str = None,
32-
img: str = "placeholder.png",
38+
img: str = None,
3339
allow_skip: bool = False,
3440
link: str = None,
3541
):
3642
self.title = title
3743
self.type = type
3844
self.content = content
3945
self.command = command
40-
self.img = img
46+
self.img = img if img else self.default_images.get(title, "placeholder.png")
4147
self.allow_skip = allow_skip
4248
self.link = link
4349

openandroidinstaller/openandroidinstaller.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
logger.add("openandroidinstaller.log")
4646

4747
# Toggle to True for development purposes
48-
DEVELOPMENT = False
48+
DEVELOPMENT = True
4949
DEVELOPMENT_CONFIG = "sargo" # "a3y17lte" # "sargo"
5050

5151

openandroidinstaller/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121

2222

2323
def get_download_link(devicecode: str) -> Optional[str]:
24-
"""Check if a lineageOS version for this device exists on lineageosroms.com and return the respective download link."""
24+
"""Check if a lineageOS version for this device exists on download.lineageos.com and return the respective download link."""
2525
url = f"https://download.lineageos.org/{devicecode.lower()}"
2626
try:
2727
logger.info(f"Checking {url}")
2828
# Get Url
29-
res = requests.get(url)
29+
res = requests.get(url, timeout=5)
3030
# if the request succeeds
3131
if res.status_code == 200:
3232
logger.info(f"{url} exists.")

openandroidinstaller/views.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def __init__(
9191
state: AppState,
9292
on_confirm: Callable,
9393
):
94-
super().__init__(state=state)
94+
super().__init__(state=state, image="requirements-default.png")
9595
self.on_confirm = on_confirm
9696

9797
def build(self):
@@ -119,7 +119,6 @@ def enable_continue_button(e):
119119
"""Enable the continue button if all checkboxes are ticked."""
120120
for checkbox in self.checkboxes:
121121
if not checkbox.value:
122-
logger.info(checkbox)
123122
self.continue_button.disabled = True
124123
return
125124
logger.info("All requirements ticked. Allow to continue")

0 commit comments

Comments
 (0)