

def resolve_conflict(self, target_folder, basename):
    "\n        If a file with the selected name already exists in the target folder,\n        this method is called to resolve the conflict. It should return a new\n        basename for the file.\n\n        The default implementation splits the name and extension and adds a\n        suffix to the name consisting of an underscore and a number, and tries\n        that until it finds one that doesn't exist.\n\n        :param target_folder: The absolute path to the target.\n        :param basename: The file's original basename.\n        "
    (name, ext) = os.path.splitext(basename)
    count = 0
    while True:
        count = (count + 1)
        newname = ('%s_%d%s' % (name, count, ext))
        if (not os.path.exists(os.path.join(target_folder, newname))):
            return newname

dataset/ETHPy150Open jeffwidman/flask-uploads/flask_uploads.py UploadSet.resolve_conflict/original