'Return the portion of a filename that is \'relative\'
to the directories in this lookup.'

def _relativeize(self, filename):

    filename = posixpath.normpath(filename)
    for dir in self.directories:
        if (filename[0:len(dir)] == dir):
            return filename[len(dir):]
    else:
        return None
