(self, percent=None, message=None)
Updates the progress bar.

        @param percent: the percentage to be shown. If C{None}, the previous
          value will be used.
        @param message: the message to be shown above the progress bar. If
          C{None}, the previous message will be used.
Updates the progress bar.
Updates the progress bar .
def update(self, percent=None, message=None):
        """Updates the progress bar.

        @param percent: the percentage to be shown. If C{None}, the previous
          value will be used.
        @param message: the message to be shown above the progress bar. If
          C{None}, the previous message will be used.
        """
        if self.cleared:
            sys.stdout.write("\n" + self.header)
            self.cleared = False

        if message is None:
            message = self.last_message
        else:
            self.last_message = message

        if percent is None:
            percent = self.last_percent
        else:
            self.last_percent = percent

        n = int((self.width - 10) * (percent / 100.0))
        sys.stdout.write(
            self.term.BOL
            + self.term.UP
            + self.term.UP
            + self.term.CLEAR_EOL
            + self.term.render(self.HEADER % message.center(self.width))
            + (self.progress_bar % (percent, "=" * n, "-" * (self.width - 10 - n)))
            + "\n"
        )
def update ( self , percent = None , message = None ) : if self . cleared : sys . stdout . write ( "\n" + self . header ) self . cleared = False if message is None : message = self . last_message else : self . last_message = message if percent is None : percent = self . last_percent else : self . last_percent = percent n = int ( ( self . width - 10 ) * ( percent / 100.0 ) ) sys . stdout . write ( self . term . BOL + self . term . UP + self . term . UP + self . term . CLEAR_EOL + self . term . render ( self . HEADER % message . center ( self . width ) ) + ( self . progress_bar % ( percent , "=" * n , "-" * ( self . width - 10 - n ) ) ) + "\n" )