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:
@@ -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."""
|
||||
Reference in New Issue
Block a user