[Bf-extensions-cvs] [2963eb2] temp-blend-utils: Let subclass of SubprocessHelper define report interval
Campbell Barton
noreply at git.blender.org
Fri Jan 29 05:53:32 CET 2016
Commit: 2963eb2b225bc8660b0bd331635de92b9e203fdf
Author: Campbell Barton
Date: Fri Jan 29 01:03:48 2016 +1100
Branches: temp-blend-utils
https://developer.blender.org/rBA2963eb2b225bc8660b0bd331635de92b9e203fdf
Let subclass of SubprocessHelper define report interval
===================================================================
M io_blend_utils/__init__.py
M io_blend_utils/bl_utils/subprocess_helper.py
===================================================================
diff --git a/io_blend_utils/__init__.py b/io_blend_utils/__init__.py
index 5eb8a67..220c107 100644
--- a/io_blend_utils/__init__.py
+++ b/io_blend_utils/__init__.py
@@ -46,6 +46,7 @@ class ExportBlendPack(Operator, ExportHelper, SubprocessHelper):
filename_ext = ".zip"
# SubprocessHelper
+ report_interval = 0.25
@classmethod
def poll(cls, context):
diff --git a/io_blend_utils/bl_utils/subprocess_helper.py b/io_blend_utils/bl_utils/subprocess_helper.py
index 3a59b70..8133f6a 100644
--- a/io_blend_utils/bl_utils/subprocess_helper.py
+++ b/io_blend_utils/bl_utils/subprocess_helper.py
@@ -30,11 +30,12 @@ class SubprocessHelper:
This class defines:
- process: The running process object.
+ _process: The running process object.
Subclass must define:
command: List of arguments to pass to subprocess.Popen
+ report_interval: Time in seconds between updating reports.
"""
@staticmethod
@@ -96,7 +97,7 @@ class SubprocessHelper:
wm = context.window_manager
window = context.window
- self._timer = wm.event_timer_add(0.25, window)
+ self._timer = wm.event_timer_add(self.report_interval, window)
window.cursor_set('WAIT')
def _wm_exit(self, context):
More information about the Bf-extensions-cvs
mailing list