mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-08-09 13:39:40 +00:00
Fix color in -q -F
and convert `ydl._out_files`/`ydl._allow_colors` to `Namespace` Closes #3761
This commit is contained in:
@@ -5322,8 +5322,20 @@ class classproperty:
|
||||
return self.f(cls)
|
||||
|
||||
|
||||
def Namespace(**kwargs):
|
||||
return collections.namedtuple('Namespace', kwargs)(**kwargs)
|
||||
class Namespace:
|
||||
"""Immutable namespace"""
|
||||
@property
|
||||
def items_(self):
|
||||
return self._dict.items()
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
self._dict = kwargs
|
||||
|
||||
def __getattr__(self, attr):
|
||||
return self._dict[attr]
|
||||
|
||||
def __repr__(self):
|
||||
return f'{type(self).__name__}({", ".join(f"{k}={v}" for k, v in self.items_)})'
|
||||
|
||||
|
||||
# Deprecated
|
||||
|
Reference in New Issue
Block a user