Exemplo n.º 1
0
    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 }
Exemplo n.º 2
0
 def __init__(self, elf):
     BinaryElementBase.__init__(self, elf)
Exemplo n.º 3
0
 def __init__(self, elf):
     BinaryElementBase.__init__(self, elf)
Exemplo n.º 4
0
 def __init__(self, elf, file, line, col):
     BinaryElementBase.__init__(self, elf)
     self.trio = (file, line, col)
Exemplo n.º 5
0
 def __init__(self, elf, file, line, col):
     BinaryElementBase.__init__(self, elf)
     self.trio = (file, line, col)