MCPcopy Index your code
hub / github.com/RustPython/RustPython / load

Function load

Lib/plistlib.py:893–912  ·  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

891
892
893def load(fp, *, fmt=None, dict_type=dict, aware_datetime=False):
894 """Read a .plist file. 'fp' should be a readable and binary file object.
895 Return the unpacked root object (which usually is a dictionary).
896 """
897 if fmt is None:
898 header = fp.read(32)
899 fp.seek(0)
900 for info in _FORMATS.values():
901 if info['detect'](header):
902 P = info['parser']
903 break
904
905 else:
906 raise InvalidFileException()
907
908 else:
909 P = _FORMATS[fmt]['parser']
910
911 p = P(dict_type=dict_type, aware_datetime=aware_datetime)
912 return p.parse(fp)
913
914
915def 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