mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2026-04-03 14:27:55 +10:00
change plugins to have both a .register that runs at import and .ready that runs later
This commit is contained in:
@@ -3,6 +3,7 @@ __package__ = 'archivebox.builtin_plugins.npm'
|
||||
from typing import List, Optional
|
||||
from pydantic import InstanceOf, Field
|
||||
|
||||
from django.conf import settings
|
||||
|
||||
from pydantic_pkgr import BinProvider, NpmProvider, BinName, PATHStr
|
||||
from plugantic.base_plugin import BasePlugin
|
||||
@@ -65,4 +66,5 @@ class NpmPlugin(BasePlugin):
|
||||
|
||||
|
||||
PLUGIN = NpmPlugin()
|
||||
PLUGIN.register(settings)
|
||||
DJANGO_APP = PLUGIN.AppConfig
|
||||
|
||||
@@ -9,6 +9,7 @@ import django
|
||||
|
||||
from django.db.backends.sqlite3.base import Database as sqlite3 # type: ignore[import-type]
|
||||
from django.core.checks import Error, Tags
|
||||
from django.conf import settings
|
||||
|
||||
from pydantic_pkgr import BinProvider, PipProvider, BinName, PATHStr, BinProviderName, ProviderLookupDict, SemVer
|
||||
from plugantic.base_plugin import BasePlugin
|
||||
@@ -139,4 +140,5 @@ class PipPlugin(BasePlugin):
|
||||
]
|
||||
|
||||
PLUGIN = PipPlugin()
|
||||
PLUGIN.register(settings)
|
||||
DJANGO_APP = PLUGIN.AppConfig
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
from pathlib import Path
|
||||
from typing import List, Dict, Optional
|
||||
|
||||
from django.conf import settings
|
||||
|
||||
# Depends on other PyPI/vendor packages:
|
||||
from pydantic import InstanceOf, Field
|
||||
from pydantic_pkgr import BinProvider, BinProviderName, ProviderLookupDict, BinName
|
||||
@@ -101,9 +103,11 @@ class SinglefilePlugin(BasePlugin):
|
||||
SINGLEFILE_CONFIG,
|
||||
SINGLEFILE_BINARY,
|
||||
SINGLEFILE_EXTRACTOR,
|
||||
SINGLEFILE_QUEUE,
|
||||
]
|
||||
|
||||
|
||||
|
||||
PLUGIN = SinglefilePlugin()
|
||||
PLUGIN.register(settings)
|
||||
DJANGO_APP = PLUGIN.AppConfig
|
||||
|
||||
@@ -2,6 +2,7 @@ from typing import List, Dict
|
||||
from subprocess import run, PIPE
|
||||
from pydantic import InstanceOf, Field
|
||||
|
||||
from django.conf import settings
|
||||
|
||||
from pydantic_pkgr import BinProvider, BinName, BinProviderName, ProviderLookupDict
|
||||
from plugantic.base_plugin import BasePlugin
|
||||
@@ -74,4 +75,5 @@ class YtdlpPlugin(BasePlugin):
|
||||
|
||||
|
||||
PLUGIN = YtdlpPlugin()
|
||||
PLUGIN.register(settings)
|
||||
DJANGO_APP = PLUGIN.AppConfig
|
||||
|
||||
Reference in New Issue
Block a user