def percentage(self):
        """Returns the progress as a percentage."""
        if self.currval >= self.maxval:
            return 100.0
        return self.currval * 100.0 / self.maxval
Returns the progress as a percentage.