Fix color in -q -F

and convert `ydl._out_files`/`ydl._allow_colors` to `Namespace`

Closes #3761
This commit is contained in:
pukkandan
2022-05-17 18:36:29 +05:30
parent 5faf6528fb
commit 591bb9d355
4 changed files with 54 additions and 43 deletions

View File

@@ -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