def set_compiz_wallpaper(filename):
    """Sets the wallpaper on one of the faces of the cube, as specified
    in webilder.wallpaper_compiz_screen_face configuration key, and sets
    this key to the next face."""

    import gconf

    # Get which screen and which face the wallpaper should be set on
    screen_face = config.get('webilder.wallpaper_compiz_screen_face',
                             'screen0,0')
    try:
        screen, face = screen_face.split(',')
        face = int(face)
    except ValueError:
        screen, face = 'screen0', 0

    # Get a list of all compiz screens
    conf_client = gconf.client_get_default()
    screens = [s.split('/')[-1]
               for s in conf_client.all_dirs('/apps/compiz/general')
               if s.split('/')[-1][:6] == 'screen']

    # Check that the screen is one of the ones supported by compiz
    if screen not in screens:
        screen = screens[0]

    # Get the number of faces on this screen
    number_of_faces = (
        conf_client.get_int('/apps/compiz/general/%s/options/hsize' % screen) *
        conf_client.get_int('/apps/compiz/general/%s/options/vsize' % screen))

    # Get the current list of wallpapers on this screen
    wallpapers = conf_client.get_list(
        '/apps/compiz/plugins/wallpaper/%s/options/bg_image' % screen,
        gconf.VALUE_STRING)

    # If list of wallpapers is too short, populate it to the correct length
    if len(wallpapers) < number_of_faces:
        wallpapers.extend([filename] * (number_of_faces - len(wallpapers)))
        prefix = '/apps/compiz/plugins/wallpaper/%s/options/' % screen
        settings = {
            'bg_color1'   : (gconf.VALUE_STRING, '#000000ff'),
            'bg_color2'   : (gconf.VALUE_STRING, '#000000ff'),
            'bg_fill_type': (gconf.VALUE_INT,    0),
            'bg_image_pos': (gconf.VALUE_INT,    0),
        }
        for key, value in settings.items():
            ext_list = conf_client.get_list(prefix + key, value[0])
            ext_list.extend([value[1]] * (number_of_faces - len(ext_list)))
            conf_client.set_list(prefix + key, value[0], ext_list)

    # Correct face if invalid
    if face >= number_of_faces or face < 0:
        face = 0

    # Set wallpaper
    wallpapers[face] = filename
    conf_client.set_list(
        '/apps/compiz/plugins/wallpaper/%s/options/bg_image' % screen,
        gconf.VALUE_STRING,
        wallpapers)

    # Set screen and face to the next value
    if face >= number_of_faces - 1:
        screen = screens[(screens.index(screen) + 1) % len(screens)]
        face = 0
    else:
        face += 1
    config.set('webilder.wallpaper_compiz_screen_face',
        '%s,%d' % (screen, face))
    config.save_config()
dataset/ETHPy150Open thesamet/webilder/src/webilder/config.py/set_compiz_wallpaper/original