def unpack(self, store, tmp): img = self.img_name() with store.upload_dir() as target: target_dir = os.path.join(target, self.base_dir) mkdir_p(target_dir) with tmpdir.tmpdir() as d: with zipfile.ZipFile(tmp.name, 'r') as zfile: zfile.extract(img, d) output_file = os.path.join(target, self.output_file()) mask.negative(os.path.join(d, img), "HFA", output_file)
def unpack(self, store, tmp): with store.upload_dir() as target: mkdir_p(os.path.join(target, self.base_dir)) output_file = os.path.join(target, self.output_file()) mask.negative(tmp.name, "GTiff", output_file)