(self, blocksSoFar, blockSize, totalSize)
| 1106 | return "{:3.1f} {}".format(size, "TB") |
| 1107 | |
| 1108 | def reportHook(self, blocksSoFar, blockSize, totalSize): |
| 1109 | # we clamp to 100% because the blockSize might be larger than the file itself |
| 1110 | percent = min(int((100.0 * blocksSoFar * blockSize) / totalSize), 100) |
| 1111 | if percent == 100 or (percent - self.downloadPercent >= 10): |
| 1112 | # we clamp to totalSize when blockSize is larger than totalSize |
| 1113 | humanSizeSoFar = self.humanFormatSize(min(blocksSoFar * blockSize, totalSize)) |
| 1114 | humanSizeTotal = self.humanFormatSize(totalSize) |
| 1115 | self.logMessage("<i>" + _("Downloaded {sizeCompleted} ({percentCompleted}% of {sizeTotal})...").format( |
| 1116 | sizeCompleted=humanSizeSoFar, percentCompleted=percent, sizeTotal=humanSizeTotal) + "</i>") |
| 1117 | self.downloadPercent = percent |
| 1118 | |
| 1119 | @staticmethod |
| 1120 | def rewriteUrl(url): |
nothing calls this directly
no test coverage detected