Beispiel #1
0
    def ExpandEntries(self):
        files = tools.GetInputFilenameGlob(self._pattern)
        if self._require_matches and not files:
            self.Raise("Pattern '%s' matched no files" % self._pattern)
        for fname in files:
            if not os.path.isfile(fname):
                continue
            name = os.path.basename(fname)
            subnode = self._node.FindNode(name)
            if not subnode:
                subnode = state.AddSubnode(self._node, name)
            state.AddString(subnode, 'type', 'blob')
            state.AddString(subnode, 'filename', fname)
            state.AddString(subnode, 'compress', self._compress)

        # Read entries again, now that we have some
        self._ReadEntries()
Beispiel #2
0
 def AddMissingProperties(self, have_image_pos):
     super().AddMissingProperties(have_image_pos)
     for entry in self._cbfs_entries.values():
         entry.AddMissingProperties(have_image_pos)
         if entry._cbfs_compress:
             state.AddZeroProp(entry._node, 'uncomp-size')
             # Store the 'compress' property, since we don't look at
             # 'cbfs-compress' in Entry.ReadData()
             state.AddString(entry._node, 'compress',
                             cbfs_util.compress_name(entry._cbfs_compress))