import random
import string


def generate_filename(status):
    """ Create a random filename -- don't collide with recent filenames """
    existing = [x.split('.')[0] for x in status['_mapping'].values()]
    while True:
        filename = ''.join(random.choice(string.ascii_uppercase) for _ in range(6))
        if filename not in existing:
            return filename