Skip to content

Commit

Permalink
Add some debug information to dbc extractor data objects. Nothing to …
Browse files Browse the repository at this point in the history
…see here carry on.

git-svn-id: https://simulationcraft.googlecode.com/svn/branches/mop@11707 3b4652a1-8050-0410-ac47-3d40261b0f8b
  • Loading branch information
navv1234 committed Apr 25, 2012
1 parent c3cf2b1 commit 4ee3df0
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion dbc_extract/dbc/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,14 @@ def __str__(self):
for i in self._fields:
s += '%s=%s ' % (i, (self._field_fmt[self._fields.index(i)] % getattr(self, i)).strip())

if self._dbc_parser._options.debug == True:
s += 'bytes=['
for b in xrange(0, len(self._record)):
s += '%.02x' % ord(self._record[b])
if (b + 1) % 4 == 0 and b < len(self._record) - 1:
s += ' '

s += ']'
return s

class SpellEffect(DBCRecord):
Expand Down Expand Up @@ -1098,7 +1106,8 @@ def initialize_data_model(build, obj):
cls_field_fmt.append('%u')
cls_format.append('I')
setattr(cls, field, 0)

setattr(cls, '%s_raw' % field, 0)

setattr(cls, '_fields', cls_fields)
setattr(cls, '_format', cls_format)
setattr(cls, '_field_fmt', cls_field_fmt)
Expand Down Expand Up @@ -1152,6 +1161,7 @@ def initialize_data_model(build, obj):

cls._field_fmt.insert(idx_field + 1, field_format)
setattr(cls, field_name, 0)
setattr(cls, '%s_raw' % field_name, 0)
elif diff_data[1] == _REMOVE_FIELD:
idx_field = cls._fields.index(diff_data[0])
if idx_field < 0:
Expand Down

0 comments on commit 4ee3df0

Please sign in to comment.