From 8f4cdd881063cf68e6535e96e098d07bef0ffa37 Mon Sep 17 00:00:00 2001 From: jaseg Date: Sun, 3 Jul 2022 22:49:00 +0200 Subject: Fix zipfile writing when lazily loading --- gerbonara/layers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gerbonara/layers.py b/gerbonara/layers.py index a64fffa..a738a45 100644 --- a/gerbonara/layers.py +++ b/gerbonara/layers.py @@ -426,7 +426,7 @@ class LayerStack: with ZipFile(path, 'w') as le_zip: for path, layer in self._save_files_iter(naming_scheme=naming_scheme): with le_zip.open(prefix + str(path), 'w') as out: - out.write(layer.write_to_bytes()) + out.write(layer.instance.write_to_bytes()) def save_to_directory(self, path, naming_scheme={}, overwrite_existing=True): outdir = Path(path) @@ -436,7 +436,7 @@ class LayerStack: out = outdir / path if out.exists() and not overwrite_existing: raise SystemError(f'Path exists but overwrite_existing is False: {out}') - layer.save(out) + layer.instance.save(out) def _save_files_iter(self, naming_scheme={}): def get_name(layer_type, layer): -- cgit