'If link is a directory, the target filename will be used as the link
name within that directory.'

def run(self):

    for (target, link) in self.links:
        if link.isdir():
            name = link.child(target.basename())
        else:
            name = link
        target.linkTo(name)
