Skip to content

Commit 56fef11

Browse files
committed
WIP
1 parent f8a4aaf commit 56fef11

4 files changed

Lines changed: 20 additions & 15 deletions

File tree

openandroidinstaller/openandroidinstaller.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,15 +199,12 @@ def log_version_infos(bin_path):
199199
# fastboot
200200
fbversion = [
201201
line
202-
for line in run_command(
203-
"fastboot --version", bin_path, enable_logging=False
204-
)
202+
for line in run_command("fastboot --version", bin_path, enable_logging=False)
205203
]
206204
logger.info(f"{fbversion[1].strip()}")
207205
# heimdall
208206
hdversion = [
209-
line
210-
for line in run_command("heimdall info", bin_path, enable_logging=False)
207+
line for line in run_command("heimdall info", bin_path, enable_logging=False)
211208
]
212209
logger.info(f"Heimdall version: {hdversion[1].strip()}")
213210

openandroidinstaller/tooling.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
PIPE,
2222
STDOUT,
2323
CalledProcessError,
24-
CompletedProcess,
2524
check_output,
2625
)
2726
import shlex
@@ -70,7 +69,7 @@ def run_command(
7069
yield p.returncode == 0
7170

7271

73-
def add_logging(step_desc: str, return_if_fail: bool=False):
72+
def add_logging(step_desc: str, return_if_fail: bool = False):
7473
def logging_decorator(func):
7574
def logging(*args, **kwargs):
7675
logger.info(step_desc)
@@ -80,8 +79,9 @@ def logging(*args, **kwargs):
8079
if return_if_fail:
8180
return
8281
yield line
83-
82+
8483
return logging
84+
8585
return logging_decorator
8686

8787

@@ -129,7 +129,10 @@ def adb_twrp_copy_partitions(bin_path: Path, config_path: Path):
129129
# now sideload the script
130130
sleep(5)
131131
logger.info("Sideload the copy_partitions script")
132-
for line in adb_sideload(bin_path=bin_path, target=f"{config_path.parent.joinpath(Path('copy-partitions-20220613-signed.zip'))}"):
132+
for line in adb_sideload(
133+
bin_path=bin_path,
134+
target=f"{config_path.parent.joinpath(Path('copy-partitions-20220613-signed.zip'))}",
135+
):
133136
yield line
134137
sleep(10)
135138
# reboot into the bootloader again

openandroidinstaller/views/addon_view.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,9 @@ def build(self):
140140
),
141141
]
142142
),
143-
Text("Here you can find instructions on how to download the right Google apps for your device."),
143+
Text(
144+
"Here you can find instructions on how to download the right Google apps for your device."
145+
),
144146
Row(
145147
[
146148
ElevatedButton(
@@ -174,10 +176,10 @@ def build(self):
174176
self.right_view.controls.extend(
175177
[
176178
Text("Select addons:", style="titleSmall"),
177-
#Markdown(
178-
#f"""
179-
#The image file should look something like `lineage-19.1-20221101-nightly-{self.state.config.metadata.get('devicecode')}-signed.zip`."""
180-
# ),
179+
# Markdown(
180+
# f"""
181+
# The image file should look something like `lineage-19.1-20221101-nightly-{self.state.config.metadata.get('devicecode')}-signed.zip`."""
182+
# ),
181183
Row(
182184
[
183185
FilledButton(

openandroidinstaller/views/step_view.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,10 @@ def display_progress_bar(self, line: str):
334334
result = None
335335
# get the progress numbers from the output lines
336336
if (type(line) == str) and line.strip():
337-
result = re.search(r"\(\~(\d{1,3})\%\)|(Total xfer:|adb: failed to read command: Success)", line.strip())
337+
result = re.search(
338+
r"\(\~(\d{1,3})\%\)|(Total xfer:|adb: failed to read command: Success)",
339+
line.strip(),
340+
)
338341
if result:
339342
if result.group(2):
340343
percentage_done = 100

0 commit comments

Comments
 (0)