self.contents_size = self.size
ok = self.ProcessContentsUpdate(data)
self.Detail('WriteData: size=%x, ok=%s' % (len(data), ok))
- return ok
+ section_ok = self.section.WriteChildData(self)
+ return ok and section_ok
+
+ def WriteChildData(self, child):
+ """Handle writing the data in a child entry
+
+ This should be called on the child's parent section after the child's
+ data has been updated. It
+
+ This base-class implementation does nothing, since the base Entry object
+ does not have any children.
+
+ Args:
+ child: Child Entry that was written
+
+ Returns:
+ True if the section could be updated successfully, False if the
+ data is such that the section could not updat
+ """
+ return True
def GetSiblingOrder(self):
"""Get the relative order of an entry amoung its siblings
self._cbfs_entries = OrderedDict()
self._ReadSubnodes()
- def ObtainContents(self):
+ def ObtainContents(self, skip=None):
arch = cbfs_util.find_arch(self._cbfs_arg)
if arch is None:
self.Raise("Invalid architecture '%s'" % self._cbfs_arg)
for entry in self._cbfs_entries.values():
# First get the input data and put it in a file. If not available,
# try later.
- if not entry.ObtainContents():
+ if entry != skip and not entry.ObtainContents():
return False
data = entry.GetData()
cfile = None
reader = self.reader
cfile = reader.files.get(child.name)
return cfile.data if decomp else cfile.orig_data
+
+ def WriteChildData(self, child):
+ self.ObtainContents(skip=child)
+ return True