def __init__(self, elf): BinaryElementBase.__init__(self, elf) self.files = set(self.query_db('select distinct path from files')) self.prefix = os.path.commonprefix([x for x in self.files if not x.startswith('/tmp/')]) idx = self.prefix.rfind('/') if idx > 0: self.prefix = self.prefix[:idx + 1] else: self.prefix = '' def unique_end(path): conflicts = set(each for each in self.files if each != path) slashpos = None while True: slashpos = path.rfind(os.path.sep, None, slashpos) if slashpos == -1: return path candidate = path[slashpos:] conflicts = set(each for each in conflicts if each.endswith(candidate)) if not conflicts: return candidate[1:] self.shortfiles = { each:unique_end(each) for each in self.files }
def __init__(self, elf): BinaryElementBase.__init__(self, elf)
def __init__(self, elf, file, line, col): BinaryElementBase.__init__(self, elf) self.trio = (file, line, col)