misc cleanup

This commit is contained in:
coletdjnz 2024-12-08 13:45:21 +13:00
parent fff5e7b708
commit 0210836dda
No known key found for this signature in database
GPG key ID: 91984263BB39894A
3 changed files with 4 additions and 10 deletions

View file

@ -177,8 +177,6 @@ from .version import CHANNEL, ORIGIN, RELEASE_GIT_HEAD, VARIANT, __version__
if os.name == 'nt':
import ctypes
__all__ = ['YoutubeDL']
def _catch_unsafe_extension_error(func):
@functools.wraps(func)

View file

@ -1,5 +1,7 @@
from collections import defaultdict
# Internal only - no backwards compatibility guaranteed
class Indirect:
def __init__(self, initial, /):
@ -9,23 +11,17 @@ class Indirect:
return f'{type(self).__name__}({self.value!r})'
# Internal only - no backwards compatibility guaranteed
postprocessors = Indirect({})
extractors = Indirect({})
IN_CLI = Indirect(False)
# `False`=force, `None`=disabled, `True`=enabled
LAZY_EXTRACTORS = Indirect(False)
# Plugins
plugin_specs = Indirect({})
# Whether plugins have been loaded once
all_plugins_loaded = Indirect(False)
plugins_enabled = Indirect(True)
plugin_dirs = Indirect(['external'])
plugin_ies = Indirect({})
plugin_overrides = Indirect(defaultdict(list))

View file

@ -51,6 +51,7 @@ from ..compat import (
compat_HTMLParseError,
)
from ..dependencies import xattr
from .._globals import IN_CLI as _IN_CLI
__name__ = __name__.rsplit('.', 1)[0] # noqa: A001: Pretend to be the parent module
@ -1483,7 +1484,6 @@ def write_string(s, out=None, encoding=None):
# TODO: Use global logger
def deprecation_warning(msg, *, printer=None, stacklevel=0, **kwargs):
from .._globals import IN_CLI as _IN_CLI
if _IN_CLI.value:
if msg in deprecation_warning._cache:
return