Start a read-validate-print loop

        The RVPL will read the user input, validate it, and loop until the
        entered value passes the validation, then return it.

        Error message can be customized using the ``error`` argument. If the
        value is a callable, it will be called with the value and it will be
        expected to return a printable message. Exceptions raised by the
        ``error`` function are not trapped.

        When ``intro`` is passed, it is printed above the prompt.

        The ``validator`` argument is is a function that validates the user
        input. Default validator simply validates if user entered any value.

        The ``clean`` argument specifies a function for the ``read()`` method
        with the same semantics.

def rvpl(self, prompt, error='Entered value is invalid', intro=None,
             validator=lambda x: x != '', clean=lambda x: x.strip(),
             strict=True, default=None):
        """ Start a read-validate-print loop

        The RVPL will read the user input, validate it, and loop until the
        entered value passes the validation, then return it.

        Error message can be customized using the ``error`` argument. If the
        value is a callable, it will be called with the value and it will be
        expected to return a printable message. Exceptions raised by the
        ``error`` function are not trapped.

        When ``intro`` is passed, it is printed above the prompt.

        The ``validator`` argument is is a function that validates the user
        input. Default validator simply validates if user entered any value.

        The ``clean`` argument specifies a function for the ``read()`` method
        with the same semantics.
        """
        if intro:
            self.pstd(utils.rewrap_long(intro))
        val = self.read(prompt, clean)
        while not validator(val):
            if not strict:
                return default
            if hasattr(error, '__call__'):
                self.perr(error(val))
            else:
                self.perr(error)
            val = self.read(prompt, clean)
        return val