| 131 | self.fh = None |
| 132 | |
| 133 | def __del__(self): |
| 134 | if self.fh is None: |
| 135 | return |
| 136 | self.fh.close() |
| 137 | if not self.done(): |
| 138 | self.plugin.warning("Incomplete file: {!r}".format(self.filename)) |
| 139 | try: |
| 140 | os.rename(self.filename, self.filename + "_INCOMPLETE") |
| 141 | except: |
| 142 | pass |
| 143 | ls = 0 |
| 144 | le = 0 |
| 145 | for s, e in self.ranges: |
| 146 | if s > le + 1: |
| 147 | self.plugin.warning( |
| 148 | "Missing bytes between {0} and {1}".format(le, s)) |
| 149 | ls, le = s, e |
| 150 | |
| 151 | def handleresponse(self, response): |
| 152 | # Check for Content Range |