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

Method build

Lib/test/test_plistlib.py:912–924  ·  view source on GitHub ↗
(self, *objects, offset_size=1, ref_size=1)

Source from the content-addressed store, hash-verified

910class TestBinaryPlistlib(unittest.TestCase):
911
912 def build(self, *objects, offset_size=1, ref_size=1):
913 data = [b'bplist00']
914 offset = 8
915 offsets = []
916 for x in objects:
917 offsets.append(offset.to_bytes(offset_size, 'big'))
918 data.append(x)
919 offset += len(x)
920 tail = struct.pack('>6xBBQQQ', offset_size, ref_size,
921 len(objects), 0, offset)
922 data.extend(offsets)
923 data.append(tail)
924 return b''.join(data)
925
926 def decode(self, *objects, offset_size=1, ref_size=1):
927 data = self.build(*objects, offset_size=offset_size, ref_size=ref_size)

Callers 5

decodeMethod · 0.95
record_namesFunction · 0.45
tree_on_pathMethod · 0.45
record_namesFunction · 0.45

Calls 6

lenFunction · 0.85
to_bytesMethod · 0.80
appendMethod · 0.45
packMethod · 0.45
extendMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected