| 48 | progressCallbackCount = len(self.payload()) / kbConstant |
| 49 | |
| 50 | def progressCallback(current, total): |
| 51 | |
| 52 | if current == 0 or total == 0: |
| 53 | return |
| 54 | |
| 55 | self.total_bytes_uploaded = current |
| 56 | |
| 57 | logger.info('+ %s upload progress %.1f%%', |
| 58 | self.url, float(current) / float(total) * 100) |
| 59 | |
| 60 | # logger.warning("deploy.progress %s", self.engine.progress()) |
| 61 | |
| 62 | ipc.signal("deploy.progress", { |
| 63 | "progress": self.engine.progress(), |
| 64 | "fileName": self.path |
| 65 | }) |
| 66 | |
| 67 | if len(self.payload()) < kbConstant: |
| 68 | progressCallback = None |