remove plugin options
This commit is contained in:
parent
35cf383589
commit
ac77c56616
2 changed files with 6 additions and 10 deletions
|
|
@ -16,12 +16,12 @@ from ytdl_sub.config.preset_class_mappings import PluginMapping
|
|||
from ytdl_sub.config.preset_options import OptionsValidator
|
||||
from ytdl_sub.config.preset_options import OutputOptions
|
||||
from ytdl_sub.config.preset_options import Overrides
|
||||
from ytdl_sub.config.preset_options import TOptionsValidator
|
||||
from ytdl_sub.config.preset_options import YTDLOptions
|
||||
from ytdl_sub.downloaders.base_downloader import BaseDownloader
|
||||
from ytdl_sub.downloaders.downloader_validator import DownloaderValidator
|
||||
from ytdl_sub.entries.entry import Entry
|
||||
from ytdl_sub.plugins.plugin import Plugin
|
||||
from ytdl_sub.plugins.plugin import PluginOptionsT
|
||||
from ytdl_sub.prebuilt_presets import PREBUILT_PRESET_NAMES
|
||||
from ytdl_sub.prebuilt_presets import PUBLISHED_PRESET_NAMES
|
||||
from ytdl_sub.utils.exceptions import ValidationException
|
||||
|
|
@ -85,7 +85,7 @@ class PresetPlugins:
|
|||
"""
|
||||
return zip(self.plugin_types, self.plugin_options)
|
||||
|
||||
def get(self, plugin_type: Type[PluginOptionsT]) -> Optional[PluginOptionsT]:
|
||||
def get(self, plugin_type: Type[TOptionsValidator]) -> Optional[TOptionsValidator]:
|
||||
"""
|
||||
Parameters
|
||||
----------
|
||||
|
|
|
|||
|
|
@ -5,10 +5,9 @@ from typing import List
|
|||
from typing import Optional
|
||||
from typing import Tuple
|
||||
from typing import Type
|
||||
from typing import TypeVar
|
||||
|
||||
from ytdl_sub.config.preset_options import OptionsValidator
|
||||
from ytdl_sub.config.preset_options import Overrides
|
||||
from ytdl_sub.config.preset_options import TOptionsValidator
|
||||
from ytdl_sub.entries.entry import Entry
|
||||
from ytdl_sub.utils.file_handler import FileMetadata
|
||||
from ytdl_sub.utils.logger import Logger
|
||||
|
|
@ -43,15 +42,12 @@ class PluginPriority:
|
|||
return self.modify_entry >= PluginPriority.MODIFY_ENTRY_AFTER_SPLIT
|
||||
|
||||
|
||||
PluginOptionsT = TypeVar("PluginOptionsT", bound=OptionsValidator)
|
||||
|
||||
|
||||
class Plugin(DownloadArchiver, Generic[PluginOptionsT], ABC):
|
||||
class Plugin(DownloadArchiver, Generic[TOptionsValidator], ABC):
|
||||
"""
|
||||
Class to define the new plugin functionality
|
||||
"""
|
||||
|
||||
plugin_options_type: Type[PluginOptionsT] = NotImplemented
|
||||
plugin_options_type: Type[TOptionsValidator] = NotImplemented
|
||||
priority: PluginPriority = PluginPriority()
|
||||
|
||||
# If the plugin creates multiple entries from a single entry
|
||||
|
|
@ -59,7 +55,7 @@ class Plugin(DownloadArchiver, Generic[PluginOptionsT], ABC):
|
|||
|
||||
def __init__(
|
||||
self,
|
||||
plugin_options: PluginOptionsT,
|
||||
plugin_options: TOptionsValidator,
|
||||
overrides: Overrides,
|
||||
enhanced_download_archive: EnhancedDownloadArchive,
|
||||
):
|
||||
|
|
|
|||
Loading…
Reference in a new issue