'Ensure that `name` does not already exist in this book. If it does, return a modified version that does not exist.'

def make_name_unique(self, name):

    counter = count()
    while (self.has_name_case_insensitive(name) or self.manifest_has_name(name)):
        c = (next(counter) + 1)
        (base, ext) = name.rpartition(u'.')[::2]
        if (c > 1):
            base = base.rpartition(u'-')[0]
        name = (u'%s-%d.%s' % (base, c, ext))
    return name
