Read a .plist file from a bytes object. Return the unpacked root object (which usually is a dictionary).
(value, *, fmt=None, dict_type=dict, aware_datetime=False)
| 913 | |
| 914 | |
| 915 | def loads(value, *, fmt=None, dict_type=dict, aware_datetime=False): |
| 916 | """Read a .plist file from a bytes object. |
| 917 | Return the unpacked root object (which usually is a dictionary). |
| 918 | """ |
| 919 | if isinstance(value, str): |
| 920 | if fmt == FMT_BINARY: |
| 921 | raise TypeError("value must be bytes-like object when fmt is " |
| 922 | "FMT_BINARY") |
| 923 | value = value.encode() |
| 924 | fp = BytesIO(value) |
| 925 | return load(fp, fmt=fmt, dict_type=dict_type, aware_datetime=aware_datetime) |
| 926 | |
| 927 | |
| 928 | def dump(value, fp, *, fmt=FMT_XML, sort_keys=True, skipkeys=False, |
no test coverage detected