mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-22 06:00:00 +00:00
parent
5792c950bf
commit
7896214c42
3 changed files with 10 additions and 7 deletions
|
@ -555,7 +555,7 @@ def __init__(self, params=None, auto_init=True):
|
||||||
)
|
)
|
||||||
self._allow_colors = Namespace(**{
|
self._allow_colors = Namespace(**{
|
||||||
type_: not self.params.get('no_color') and supports_terminal_sequences(stream)
|
type_: not self.params.get('no_color') and supports_terminal_sequences(stream)
|
||||||
for type_, stream in self._out_files.items_ if type_ != 'console'
|
for type_, stream in self._out_files if type_ != 'console'
|
||||||
})
|
})
|
||||||
|
|
||||||
if sys.version_info < (3, 6):
|
if sys.version_info < (3, 6):
|
||||||
|
@ -3611,7 +3611,7 @@ def get_encoding(stream):
|
||||||
sys.getfilesystemencoding(),
|
sys.getfilesystemencoding(),
|
||||||
self.get_encoding(),
|
self.get_encoding(),
|
||||||
', '.join(
|
', '.join(
|
||||||
f'{key} {get_encoding(stream)}' for key, stream in self._out_files.items_
|
f'{key} {get_encoding(stream)}' for key, stream in self._out_files
|
||||||
if stream is not None and key != 'console')
|
if stream is not None and key != 'console')
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -301,7 +301,7 @@ def _finish_multiline_status(self):
|
||||||
)
|
)
|
||||||
|
|
||||||
def _report_progress_status(self, s, default_template):
|
def _report_progress_status(self, s, default_template):
|
||||||
for name, style in self.ProgressStyles.items_:
|
for name, style in self.ProgressStyles:
|
||||||
name = f'_{name}_str'
|
name = f'_{name}_str'
|
||||||
if name not in s:
|
if name not in s:
|
||||||
continue
|
continue
|
||||||
|
|
|
@ -5324,9 +5324,6 @@ def __get__(self, _, cls):
|
||||||
|
|
||||||
class Namespace:
|
class Namespace:
|
||||||
"""Immutable namespace"""
|
"""Immutable namespace"""
|
||||||
@property
|
|
||||||
def items_(self):
|
|
||||||
return self._dict.items()
|
|
||||||
|
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
self._dict = kwargs
|
self._dict = kwargs
|
||||||
|
@ -5334,8 +5331,14 @@ def __init__(self, **kwargs):
|
||||||
def __getattr__(self, attr):
|
def __getattr__(self, attr):
|
||||||
return self._dict[attr]
|
return self._dict[attr]
|
||||||
|
|
||||||
|
def __contains__(self, item):
|
||||||
|
return item in self._dict.values()
|
||||||
|
|
||||||
|
def __iter__(self):
|
||||||
|
return iter(self._dict.items())
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return f'{type(self).__name__}({", ".join(f"{k}={v}" for k, v in self.items_)})'
|
return f'{type(self).__name__}({", ".join(f"{k}={v}" for k, v in self)})'
|
||||||
|
|
||||||
|
|
||||||
# Deprecated
|
# Deprecated
|
||||||
|
|
Loading…
Reference in a new issue