def safe_filename(filename):
    """
    Clean the filename so that it can be used as a valid filename
    """
    return filename.\
        replace('=', ''). \
        replace('\n', ''). \
        replace('/', '_'). \
        replace('\\', '_'). \
        replace('$', ''). \
        replace(';', ''). \
        replace('*', '_')