MCPcopy Index your code
hub / github.com/python/cpython / load

Function load

Lib/plistlib.py:886–905  ·  view source on GitHub ↗

Read a .plist file. 'fp' should be a readable and binary file object. Return the unpacked root object (which usually is a dictionary).

(fp, *, fmt=None, dict_type=dict, aware_datetime=False)

Source from the content-addressed store, hash-verified

884
885
886def load(fp, *, fmt=None, dict_type=dict, aware_datetime=False):
887 """Read a .plist file. 'fp' should be a readable and binary file object.
888 Return the unpacked root object (which usually is a dictionary).
889 """
890 if fmt is None:
891 header = fp.read(32)
892 fp.seek(0)
893 for info in _FORMATS.values():
894 if info['detect'](header):
895 P = info['parser']
896 break
897
898 else:
899 raise InvalidFileException()
900
901 else:
902 P = _FORMATS[fmt]['parser']
903
904 p = P(dict_type=dict_type, aware_datetime=aware_datetime)
905 return p.parse(fp)
906
907
908def loads(value, *, fmt=None, dict_type=dict, aware_datetime=False):

Callers 2

loadsFunction · 0.70
_mainFunction · 0.70

Calls 6

PClass · 0.50
readMethod · 0.45
seekMethod · 0.45
valuesMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…