Download .venv/lib/python3.12/site-packages/fontTools/ufoLib/plistlib.py from FaustDerLegende/split: direct link, hf CLI and curl.
- Browser
- Download file 1.51 kB
-
https://huggingface.co/datasets/FaustDerLegende/split/resolve/main/.venv/lib/python3.12/site-packages/fontTools/ufoLib/plistlib.py
- Command line
-
hf download hf://datasets/FaustDerLegende/split/.venv/lib/python3.12/site-packages/fontTools/ufoLib/plistlib.py
-
curl -L -o plistlib.py https://huggingface.co/datasets/FaustDerLegende/split/resolve/main/.venv/lib/python3.12/site-packages/fontTools/ufoLib/plistlib.py
1.51 kB
| """DEPRECATED - This module is kept here only as a backward compatibility shim | |
| for the old `ufoLib.plistlib` module, which was moved to :class:`fontTools.misc.plistlib`. | |
| Please use the latter instead. | |
| """ | |
| from fontTools.misc.plistlib import dump, dumps, load, loads | |
| from fontTools.misc.textTools import tobytes | |
| # The following functions were part of the old py2-like ufoLib.plistlib API. | |
| # They are kept only for backward compatiblity. | |
| from fontTools.ufoLib.utils import deprecated | |
| def readPlist(path_or_file): | |
| did_open = False | |
| if isinstance(path_or_file, str): | |
| path_or_file = open(path_or_file, "rb") | |
| did_open = True | |
| try: | |
| return load(path_or_file, use_builtin_types=False) | |
| finally: | |
| if did_open: | |
| path_or_file.close() | |
| def writePlist(value, path_or_file): | |
| did_open = False | |
| if isinstance(path_or_file, str): | |
| path_or_file = open(path_or_file, "wb") | |
| did_open = True | |
| try: | |
| dump(value, path_or_file, use_builtin_types=False) | |
| finally: | |
| if did_open: | |
| path_or_file.close() | |
| def readPlistFromString(data): | |
| return loads(tobytes(data, encoding="utf-8"), use_builtin_types=False) | |
| def writePlistToString(value): | |
| return dumps(value, use_builtin_types=False) | |