[Bf-extensions-cvs] [b196c48] master: blendfile: add __repr__ to DNAName and DNAStruct

Sybren A. Stüvel noreply at git.blender.org
Thu Jun 23 01:06:52 CEST 2016


Commit: b196c481d2eda932832daf4f65a68c80a8bdad5e
Author: Sybren A. Stüvel
Date:   Wed Jun 22 14:15:33 2016 +0200
Branches: master
https://developer.blender.org/rBAb196c481d2eda932832daf4f65a68c80a8bdad5e

blendfile: add __repr__ to DNAName and DNAStruct

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

M	io_blend_utils/blend/blendfile.py

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

diff --git a/io_blend_utils/blend/blendfile.py b/io_blend_utils/blend/blendfile.py
index 154943b..516524a 100644
--- a/io_blend_utils/blend/blendfile.py
+++ b/io_blend_utils/blend/blendfile.py
@@ -613,6 +613,9 @@ class DNAName:
         self.is_method_pointer = self.calc_is_method_pointer()
         self.array_size = self.calc_array_size()
 
+    def __repr__(self):
+        return '%s(%r)' % (type(self).__qualname__, self.name_full)
+
     def as_reference(self, parent):
         if parent is None:
             result = b''
@@ -691,6 +694,9 @@ class DNAStruct:
         self.field_from_name = {}
         self.user_data = None
 
+    def __repr__(self):
+        return '%s(%r)' % (type(self).__qualname__, self.dna_type_id)
+
     def field_from_path(self, header, handle, path):
         """
         Support lookups as bytes or a tuple of bytes and optional index.



More information about the Bf-extensions-cvs mailing list