Lines Matching refs:payload_file
82 def ReadFromPayload(self, payload_file, hasher=None): argument
100 magic = common.Read(payload_file, len(self._MAGIC), hasher=hasher)
104 self.version = _ReadInt(payload_file, self._VERSION_SIZE, True,
106 self.manifest_len = _ReadInt(payload_file, self._MANIFEST_LEN_SIZE, True,
115 payload_file, self._METADATA_SIGNATURE_LEN_SIZE, True,
118 def __init__(self, payload_file, payload_file_offset=0): argument
125 if zipfile.is_zipfile(payload_file):
126 with zipfile.ZipFile(payload_file) as zfp:
127 self.payload_file = zfp.open("payload.bin", "r")
128 elif isinstance(payload_file, str):
129 payload_fp = open(payload_file, "rb")
131 self.payload_file = io.BytesIO(payload_bytes)
133 self.payload_file = payload_file
153 header.ReadFromPayload(self.payload_file, self.manifest_hasher)
168 return common.Read(self.payload_file, self.header.manifest_len,
185 self.payload_file, self.header.metadata_signature_len,
202 return common.Read(self.payload_file, length,
221 self.payload_file.seek(self.payload_file_offset)
247 self.payload_file.seek(self.payload_file_offset + self.data_offset)