Update PyInstaller hook

This commit is contained in:
Timmy Welch 2023-01-12 15:37:27 -08:00
parent 712986ee69
commit 50614d52fc
No known key found for this signature in database
3 changed files with 14 additions and 13 deletions

View File

@ -1,6 +1,6 @@
from __future__ import annotations
from PyInstaller.utils.hooks import collect_data_files
from PyInstaller.utils.hooks import collect_data_files, collect_entry_point
datas = []
datas, hiddenimports = collect_entry_point("comicapi.archiver")
datas += collect_data_files("comicapi.data")

View File

@ -53,16 +53,17 @@ archivers: list[type[Archiver]] = []
def load_archive_plugins() -> None:
for arch in entry_points(group="comicapi_archivers"):
try:
archiver: type[Archiver] = arch.load()
if archiver.enabled:
if not arch.module.startswith("comicapi"):
archivers.insert(0, archiver)
else:
archivers.append(archiver)
except Exception:
logger.warning("Failed to load talker: %s", arch.name)
if not archivers:
for arch in entry_points(group="comicapi.archiver"):
try:
archiver: type[Archiver] = arch.load()
if archiver.enabled:
if not arch.module.startswith("comicapi"):
archivers.insert(0, archiver)
else:
archivers.append(archiver)
except Exception:
logger.warning("Failed to load talker: %s", arch.name)
class MetaDataStyle:

View File

@ -64,7 +64,7 @@ setup(
"pyinstaller40": [
"hook-dirs = comictaggerlib.__pyinstaller:get_hook_dirs",
],
"comicapi.archivers": [
"comicapi.archiver": [
"zip = comicapi.archivers.zip:ZipArchiver",
"sevenzip = comicapi.archivers.sevenzip:SevenZipArchiver",
"rar = comicapi.archivers.rar:RarArchiver",