Show More
@@ -292,16 +292,22 class unbundle20(object): | |||
|
292 | 292 | data = headerblock[offset:(offset + size)] |
|
293 | 293 | self._offset = offset + size |
|
294 | 294 | return data |
|
295 | typesize = _unpack(_fparttypesize, fromheader(1))[0] | |
|
295 | def unpackheader(format): | |
|
296 | """read given format from header | |
|
297 | ||
|
298 | This automatically compute the size of the format to read.""" | |
|
299 | data = fromheader(struct.calcsize(format)) | |
|
300 | return _unpack(format, data) | |
|
301 | ||
|
302 | typesize = unpackheader(_fparttypesize)[0] | |
|
296 | 303 | parttype = fromheader(typesize) |
|
297 | 304 | self.ui.debug('part type: "%s"\n' % parttype) |
|
298 | 305 | ## reading parameters |
|
299 | 306 | # param count |
|
300 |
mancount, advcount = |
|
|
307 | mancount, advcount = unpackheader(_fpartparamcount) | |
|
301 | 308 | self.ui.debug('part parameters: %i\n' % (mancount + advcount)) |
|
302 | 309 | # param size |
|
303 |
paramsizes = |
|
|
304 | fromheader(2*(mancount + advcount))) | |
|
310 | paramsizes = unpackheader(_makefpartparamsizes(mancount + advcount)) | |
|
305 | 311 | # make it a list of couple again |
|
306 | 312 | paramsizes = zip(paramsizes[::2], paramsizes[1::2]) |
|
307 | 313 | # split mandatory from advisory |
General Comments 0
You need to be logged in to leave comments.
Login now