[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [35639] trunk/blender/source/tests/ batch_import.py: print how many times the operator failed.

Campbell Barton ideasman42 at gmail.com
Sun Mar 20 10:38:26 CET 2011


Revision: 35639
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=35639
Author:   campbellbarton
Date:     2011-03-20 09:38:25 +0000 (Sun, 20 Mar 2011)
Log Message:
-----------
print how many times the operator failed.

Modified Paths:
--------------
    trunk/blender/source/tests/batch_import.py

Modified: trunk/blender/source/tests/batch_import.py
===================================================================
--- trunk/blender/source/tests/batch_import.py	2011-03-20 07:23:17 UTC (rev 35638)
+++ trunk/blender/source/tests/batch_import.py	2011-03-20 09:38:25 UTC (rev 35639)
@@ -103,10 +103,12 @@
     if len(files) != files_len:
         print(" using a subset in (%d, %d), total %d" % (start, end, len(files)), end="")
 
-    print("")
-
     import bpy
     op = eval(operator)
+
+    tot_done = 0
+    tot_fail = 0
+
     for i, f in enumerate(files):
         print("    %s(filepath=%r) # %d of %d" % (operator, f, i + start, len(files)))
 
@@ -118,8 +120,13 @@
         addon_utils.reset_all = _reset_all  # XXX, hack
         clear_scene()
 
-        op(filepath=f)
+        result = op(filepath=f)
 
+        if 'FINISHED' in result:
+            tot_done += 1
+        else:
+            tot_fail += 1
+
         if save_path:
             fout = os.path.join(save_path, os.path.relpath(f, path))
             fout_blend = os.path.splitext(fout)[0] + ".blend"
@@ -132,7 +139,9 @@
 
             bpy.ops.wm.save_as_mainfile(filepath=fout_blend)
 
+    print("finished, done:%d,  fail:%d" % (tot_done, tot_fail))
 
+
 def main():
     import optparse
 




More information about the Bf-blender-cvs mailing list