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)
| 906 | |
| 907 | |
| 908 | def loads(value, *, fmt=None, dict_type=dict, aware_datetime=False): |
| 909 | """Read a .plist file from a bytes object. |
| 910 | Return the unpacked root object (which usually is a dictionary). |
| 911 | """ |
| 912 | if isinstance(value, str): |
| 913 | if fmt == FMT_BINARY: |
| 914 | raise TypeError("value must be bytes-like object when fmt is " |
| 915 | "FMT_BINARY") |
| 916 | value = value.encode() |
| 917 | fp = BytesIO(value) |
| 918 | return load(fp, fmt=fmt, dict_type=dict_type, aware_datetime=aware_datetime) |
| 919 | |
| 920 | |
| 921 | def dump(value, fp, *, fmt=FMT_XML, sort_keys=True, skipkeys=False, |