From d0651e0b0a64cfa5a7a1f0443cf25af75883f4ae Mon Sep 17 00:00:00 2001 From: seppzer0 Date: Fri, 1 Mar 2024 16:32:27 +0300 Subject: [PATCH] refactor: simplify variable usage for DFD --- wrapper/commands/assets.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/wrapper/commands/assets.py b/wrapper/commands/assets.py index 7588d1d..5693e34 100644 --- a/wrapper/commands/assets.py +++ b/wrapper/commands/assets.py @@ -44,8 +44,7 @@ def rom_collector_dto(self) -> LineageOsApi | ParanoidAndroidApi | None: @property def assets(self) -> list[str | GitHubApi | LineageOsApi | ParanoidAndroidApi]: # define dm-verity and forceencrypt disabler (DFD) and SU manager - dfd = GitHubApi(project="seppzer0/Disable_Dm-Verity_ForceEncrypt") - dfd_res = dfd.run() + dfd = GitHubApi(project="seppzer0/Disable_Dm-Verity_ForceEncrypt").run() su_manager = "tiann/KernelSU" if self.ksu else "topjohnwu/Magisk" # process the "ROM-only" download for non-universal kernel bases if self.rom_only: @@ -54,8 +53,8 @@ def assets(self) -> list[str | GitHubApi | LineageOsApi | ParanoidAndroidApi]: else: # add DFD alongside the ROM fo.download(self.rom_collector_dto.run()) - if dfd_res: - fo.download(dfd_res) + if dfd: + fo.download(dfd) print("\n", end="") msg.done("ROM-only asset collection complete!") # process the non-"RON-only" download @@ -99,8 +98,8 @@ def assets(self) -> list[str | GitHubApi | LineageOsApi | ParanoidAndroidApi]: # finally, add ROM (if kernel base is not universal) and DFD into assets list if self.rom_collector_dto: assets.append(self.rom_collector_dto.run()) - if dfd_res: - assets.append(dfd_res) + if dfd: + assets.append(dfd) def _check(self) -> None: os.chdir(dcfg.root)