blendfile: add __repr__ to DNAName and DNAStruct

This commit is contained in:
Sybren A. Stüvel 2016-06-22 14:15:33 +02:00 committed by Campbell Barton
parent a668b0b741
commit b196c481d2
1 changed files with 6 additions and 0 deletions

View File

@ -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.