def update(self, sent):
        """ Update self and parent with intermediate progress. """
        self.offset = sent

        now = datetime.datetime.now()

        elapsed = (now - self.startTime).total_seconds()
        if elapsed > 0:
            mbps = (sent * 8 / (10 ** 6)) / elapsed
        else:
            mbps = None

        self._display(sent, now, self.name, mbps)
def update ( self , sent ) : self . offset = sent now = datetime . datetime . now ( ) elapsed = ( now - self . startTime ) . total_seconds ( ) if elapsed > 0 : mbps = ( sent * 8 / ( 10 ** 6 ) ) / elapsed else : mbps = None self . _display ( sent , now , self . name , mbps )
Update self and parent with intermediate progress.