Configure the block from an (horible) configuration dictionary (or
        list) this data are coming from a json client request and has to be
        parsed. It takes the default value if missing (for component selection
        and options).

        :param config: component to use and the associated options 
        :type config: `dict` or `list`

        `config` format ::

            {
                'name': name_of_the_comp_to_use,
                'options': {
                    name: value,
                    name: va...
                }
            }

        or for multiple selection ::

            [
                {
                    'name': name_of_the_comp_to_use,
                    'options': {
                        name: value,
                        name: va...
                    }
                },
                {...}
            ]

        .. warning:: values of options in this dictionnary are strings

def configure(self, config):
        """ Configure the block from an (horible) configuration dictionary (or
        list) this data are coming from a json client request and has to be
        parsed. It takes the default value if missing (for component selection
        and options).

        :param config: component to use and the associated options 
        :type config: `dict` or `list`

        `config` format ::

            {
                'name': name_of_the_comp_to_use,
                'options': {
                    name: value,
                    name: va...
                }
            }

        or for multiple selection ::

            [
                {
                    'name': name_of_the_comp_to_use,
                    'options': {
                        name: value,
                        name: va...
                    }
                },
                {...}
            ]

        .. warning:: values of options in this dictionnary are strings

        """
        self._logger.info("configure block <%s>" % self.name)
        # normalise input format
        if isinstance(config, dict):
            if len(config) == 0:
                config = []
            else:
                config = [config]
        # check errors
        if self.hidden and len(config):
            raise ValueError("Component '%s' is hidden you can't change it's configuration from here" % self.name)
        if self.required and len(self.defaults) == 0 and len(config) == 0:
            raise ValueError("Component '%s' is required but none given (and no defaults)" % self.name)
        # comp is given
        if not self.multiple and len(config) > 1:
            raise ValueError("Block '%s' allows only one component to be selected" % self.name)
        # check input dict
        for req_comp in config:
            if 'name' not in req_comp:
                raise ValueError("No 'name' value in config for block '%s' " % self.name)
            if req_comp['name'] not in self:
                raise ValueError("Invalid component (%s) for block '%s' "
                    % (req_comp['name'], self.name))

        # remove selection and reset to default options
        self.clear_selections()

        # configure the block
        # select and set options
        for req_comp in config:
            self.select(req_comp['name'], req_comp.get("options", {}))