for i in range(len([p for p in f.namelist()
if p.endswith('segment-header.properties')])):
segments.append(self._zip_segment(f, path, info, zip_info, i))
- for name in ['approach', 'retract']:
- if len([s for s in segments if s.info['name'] == name]) == 0:
- raise ValueError(
- 'No segment for %s in %s, only %s'
- % (name, path, [s.info['name'] for s in segments]))
- return (segments,
- self._zip_translate_params(zip_info,
- segments[0].info['raw info']))
+ if zip_info['file-format-version'] not in ['0.5']:
+ raise NotImplementedError(
+ 'JPK file version %s not supported (yet).'
+ % zip_info['file-format-version'])
+ for name in ['approach', 'retract']:
+ if len([s for s in segments if s.info['name'] == name]) == 0:
+ raise ValueError(
+ 'No segment for %s in %s, only %s'
+ % (name, path, [s.info['name'] for s in segments]))
+ return (segments,
+ self._zip_translate_params(zip_info,
+ segments[0].info['raw info']))
def _zip_info(self, zipfile):
with Closing(zipfile.open('header.properties')) as f: