def set(self, value, custom_command=True):
        """Set the value of the widget.

        Parameters
        ==========
        value (python literal)
            the value of the widget.
        custom_command (boolean)
            indicates whether the custom command should be
            called after updating the value.
        """
        ### changes are only performed if the new value is
        ### indeed different from the current one

        if self.value != value and is_python_literal(repr(value)):

            ### store new value
            self.value = value

            ### update image
            self.update_image()

            ### if requested, execute the custom command
            if custom_command:
                self.command()
Set the value of the widget.

        Parameters
        ==========
        value (python literal)
            the value of the widget.
        custom_command (boolean)
            indicates whether the custom command should be
            called after updating the value.
        
nodezator/widget/literaldisplay.py