Implemented reporting callbacks.

Both the dependency Tracer class and the Packer class now support a
callback object, where the latter is a subclass of the former.

For file transfers running in a separate thread, there is a thread-safe
wrapper for progress callbacks. This wrapper can be called from any thread,
and calls the wrapped callback object from the main thread. This way the
callback implementation itself doesn't have to worry about threading
issues.
This commit is contained in:
Sybren A. Stüvel
2018-03-15 17:59:55 +01:00
parent d2e13750e9
commit 889f3abd25
10 changed files with 421 additions and 68 deletions
+12
View File
@@ -0,0 +1,12 @@
"""Callback class definition for BAT Tracer progress reporting.
Mostly used to forward events to pack.progress.Callback.
"""
import pathlib
class Callback:
"""BAT Tracer progress reporting."""
def trace_blendfile(self, filename: pathlib.Path) -> None:
"""Called for every blendfile opened when tracing dependencies."""