Commit: 52f1537feb998248a4e9d438a9cf48ae312ce89b
Author: Campbell Barton
Date:   Wed May 6 00:32:15 2015 +1000
Branches: ui-preview-buttons
https://developer.blender.org/rB52f1537feb998248a4e9d438a9cf48ae312ce89b

Use a resource warning

===================================================================

M       release/scripts/modules/bpy/utils/previews.py

===================================================================

diff --git a/release/scripts/modules/bpy/utils/previews.py 
b/release/scripts/modules/bpy/utils/previews.py
index 1548fd5..a848fcc 100644
--- a/release/scripts/modules/bpy/utils/previews.py
+++ b/release/scripts/modules/bpy/utils/previews.py
@@ -58,7 +58,10 @@ class BPyPreviewsCollection(dict):
         if self._uuid not in _uuid_open:
             return
 
-        raise Warning("%r: left open, remove with 
'bpy.utils.previews.remove()'")
+        raise ResourceWarning(
+                "<%s id=%s[%d]>: left open, remove with "
+                "'bpy.utils.previews.remove()'" %
+                (self.__class__.__name__, self._uuid, len(self)))
         self.close()
 
     def _gen_key(self, name):
@@ -96,7 +99,11 @@ class BPyPreviewsCollection(dict):
         return self.release(key)
 
     def __repr__(self):
-        return "<PreviewsCollection '%s'>\n\tPreviews: %s" % (self._uuid, 
super().__repr__())
+        return "<%s id=%s[%d], %s>" % (
+                self.__class__.__name__,
+                self._uuid,
+                len(self),
+                super().__repr__())
 
 
 def new():

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to