File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2323
2424
2525class 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
Original file line number Diff line number Diff line change 4545logger .add ("openandroidinstaller.log" )
4646
4747# Toggle to True for development purposes
48- DEVELOPMENT = False
48+ DEVELOPMENT = True
4949DEVELOPMENT_CONFIG = "sargo" # "a3y17lte" # "sargo"
5050
5151
Original file line number Diff line number Diff line change 2121
2222
2323def 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." )
Original file line number Diff line number Diff 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" )
You can’t perform that action at this time.
0 commit comments