Update PyInstaller hook
This commit is contained in:
parent
712986ee69
commit
50614d52fc
@ -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")
|
||||
|
@ -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:
|
||||
|
2
setup.py
2
setup.py
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user