logo

youtube-dl

[mirror] Download/Watch videos from video hostersgit clone https://hacktivis.me/git/mirror/youtube-dl.git
commit: 26b6f15d14e30dc3349abe2933edb051b46be4b8
parent 5975d7bb96095fae7c35e7cfcd819255a5b57087
Author: dirkf <fieldhouse@gmx.net>
Date:   Mon,  3 Feb 2025 18:10:15 +0000

[compat] Make casefold private
* if required, not supported:
`from youtube_dl.casefold import _casefold as casefold`

Diffstat:

Myoutube_dl/casefold.py12++++--------
Myoutube_dl/compat.py2+-
2 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/youtube_dl/casefold.py b/youtube_dl/casefold.py @@ -10,9 +10,10 @@ from .compat import ( # https://github.com/unicode-org/icu/blob/main/icu4c/source/data/unidata/CaseFolding.txt # In case newly foldable Unicode characters are defined, paste the new version # of the text inside the ''' marks. -# The text is expected to have only blank lines andlines with 1st character #, +# The text is expected to have only blank lines and lines with 1st character #, # all ignored, and fold definitions like this: -# `from_hex_code; space_separated_to_hex_code_list; comment` +# `from_hex_code; status; space_separated_to_hex_code_list; comment` +# Only `status` C/F are used. _map_str = ''' # CaseFolding-15.0.0.txt @@ -1657,11 +1658,6 @@ _map = dict( del _map_str -def casefold(s): +def _casefold(s): assert isinstance(s, compat_str) return ''.join((_map.get(c, c) for c in s)) - - -__all__ = [ - 'casefold', -] diff --git a/youtube_dl/compat.py b/youtube_dl/compat.py @@ -44,7 +44,7 @@ try: compat_str.casefold compat_casefold = lambda s: s.casefold() except AttributeError: - from .casefold import casefold as compat_casefold + from .casefold import _casefold as compat_casefold try: import collections.abc as compat_collections_abc