diff --git a/import2ledger/__main__.py b/import2ledger/__main__.py index 7520fd5aa58b1d8b71fea14bd4e2f144f9e0028e..76fb9210209f8002c30addbf68e00bfb4d45d5f1 100644 --- a/import2ledger/__main__.py +++ b/import2ledger/__main__.py @@ -41,11 +41,13 @@ class FileImporter: default_date = self.config.get_default_date() in_file.seek(0) for entry_data in importer(in_file): + entry_data['_hook_cancel'] = False for hook in self.hooks: hook.run(entry_data) - if not entry_data: + if entry_data['_hook_cancel']: break else: + del entry_data['_hook_cancel'] print(template.render(**entry_data), file=out_file, end='') def import_path(self, in_path):