def resume_editing(self):
        """Resume editing the contents.

        If the contents in the entry are equal to the actual
        value stored, we just get out of the widget (lose
        focus).

        Otherwise, we check whether such contents are valid.
        If not, we restore the original value. If it is,
        we perform tasks to store it.
        """
        ### retrieve the entry text
        entry_text = self.cursor.get()

        try:
            value = literal_eval(entry_text)
        except:

            self.cursor.set(repr(self.value))
            self.update_image()
            self.lose_focus()

        if value == self.value:
            self.cursor.set(repr(self.value))
            self.update_image()
            self.lose_focus()

        ### if the value changed, store the new value
        ### update the image, then execute the custom
        ### command

        self.value = value

        # it is important to do this before executing
        # the custom command, such command is provided by
        # the user and we never know which effect it may
        # have
        self.update_image()

        # execute the custom command
        self.command()

        ### finally we lose focus
        self.lose_focus()
Resume editing the contents.

        If the contents in the entry are equal to the actual
        value stored, we just get out of the widget (lose
        focus).

        Otherwise, we check whether such contents are valid.
        If not, we restore the original value. If it is,
        we perform tasks to store it.
        
nodezator/widget/literalentry.py