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()

        ### if contents are equal to value, just update
        ### the image (so that it doesn't contain
        ### the outline of the cursor in it)

        if entry_text == self.value:
            self.update_image()

        ### if the contents changed, though, we must check
        ### if it is valid and perform extra setups
        ### depending on that

        else:

            ## if contents are valid, store the contents
            ## as the value of the widget, update the image,
            ## then execute the custom command

            if self.validation_command(entry_text):

                # format contents
                formatted_value = self.formatting_command(entry_text)

                # set formatted value as entry text
                self.cursor.set(formatted_value)

                # set formatted value as value
                self.value = formatted_value

                # update the image (it is important to do
                # this before executing the command, since
                # the command is given by the user and we
                # never know which effect it may have)
                self.update_image()

                # execute the custom command
                self.command()

            ## otherwise set the entry text to the
            ## current value and update the image

            else:

                # since text on cursor is different from
                # self.value, set self.value as its text
                self.cursor.set(self.value)

                # udpate image
                self.update_image()

        ### 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/stringentry.py