Installer: log process (#1530)

This commit is contained in:
calle 2023-02-21 12:19:50 +01:00 committed by GitHub
parent 76ffb8a607
commit c5e2bbc1c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -243,6 +243,7 @@ class InstallableExtension(BaseModel):
return config_json.get("is_installed") is True
def download_archive(self):
logger.info(f"Downloading extension {self.name}.")
ext_zip_file = self.zip_path
if os.path.isfile(ext_zip_file):
os.remove(ext_zip_file)
@ -266,6 +267,7 @@ class InstallableExtension(BaseModel):
)
def extract_archive(self):
logger.info(f"Extracting extension {self.name}.")
os.makedirs(os.path.join("lnbits", "upgrades"), exist_ok=True)
shutil.rmtree(self.ext_upgrade_dir, True)
with zipfile.ZipFile(self.zip_path, "r") as zip_ref:
@ -304,6 +306,7 @@ class InstallableExtension(BaseModel):
os.path.join(self.ext_upgrade_dir, self.id),
os.path.join("lnbits", "extensions", self.id),
)
logger.success(f"Extension {self.name} installed.")
def nofiy_upgrade(self) -> None:
"""Update the list of upgraded extensions. The middleware will perform redirects based on this"""