##// END OF EJS Templates
progress: change _updatebar() to take parameters as arguments...
Yuya Nishihara -
r41245:b223fc1c default
parent child Browse files
Show More
@@ -1428,16 +1428,14 class progress(object):
1428 1428 # TODO: consider porting some useful information (e.g. estimated
1429 1429 # time) from progbar. we might want to support update delay to
1430 1430 # reduce the cost of transferring progress messages.
1431 def updatebar(item):
1432 ui._fmsgerr.write(None, type=b'progress', topic=self.topic,
1433 pos=self.pos, item=item, unit=self.unit,
1434 total=self.total)
1431 def updatebar(topic, pos, item, unit, total):
1432 ui._fmsgerr.write(None, type=b'progress', topic=topic,
1433 pos=pos, item=item, unit=unit,
1434 total=total)
1435 1435 elif ui._progbar is not None:
1436 def updatebar(item):
1437 ui._progbar.progress(self.topic, self.pos, item=item,
1438 unit=self.unit, total=self.total)
1436 updatebar = ui._progbar.progress
1439 1437 else:
1440 def updatebar(item):
1438 def updatebar(topic, pos, item, unit, total):
1441 1439 pass
1442 1440 self._updatebar = updatebar
1443 1441
@@ -1452,7 +1450,7 class progress(object):
1452 1450 if total:
1453 1451 self.total = total
1454 1452 self.pos = pos
1455 self._updatebar(item)
1453 self._updatebar(self.topic, self.pos, item, self.unit, self.total)
1456 1454 if self.debug:
1457 1455 self._printdebug(item)
1458 1456
@@ -1463,7 +1461,7 class progress(object):
1463 1461 self.pos = None
1464 1462 self.unit = ""
1465 1463 self.total = None
1466 self._updatebar("")
1464 self._updatebar(self.topic, self.pos, "", self.unit, self.total)
1467 1465
1468 1466 def _printdebug(self, item):
1469 1467 if self.unit:
General Comments 0
You need to be logged in to leave comments. Login now