When aborting, make sure the reason is available

This allows a GUI to display the reason of abortion.
This commit is contained in:
Sybren A. Stüvel
2019-03-01 14:07:24 +01:00
parent 6104bd6078
commit f34bf7c66f
3 changed files with 17 additions and 4 deletions
+4 -1
View File
@@ -42,7 +42,7 @@ class Callback(blender_asset_tracer.trace.progress.Callback):
missing_files: typing.Set[pathlib.Path]) -> None:
"""Called when packing is done."""
def pack_aborted(self):
def pack_aborted(self, reason: str):
"""Called when packing was aborted."""
def trace_blendfile(self, filename: pathlib.Path) -> None:
@@ -109,6 +109,9 @@ class ThreadSafeCallback(Callback):
missing_files: typing.Set[pathlib.Path]) -> None:
self._queue(self.wrapped.pack_done, output_blendfile, missing_files)
def pack_aborted(self, reason: str):
self._queue(self.wrapped.pack_aborted, reason)
def trace_blendfile(self, filename: pathlib.Path) -> None:
self._queue(self.wrapped.trace_blendfile, filename)