fix for sequence size mismatch when loading themes, addition of alpha channel caused themes not to load.

This commit is contained in:
Campbell Barton
2012-12-13 09:46:24 +00:00
parent 223cb8c94a
commit 15634fd22e

View File

@@ -265,7 +265,15 @@ def xml2rna(root_xml,
tp_name = 'ARRAY' tp_name = 'ARRAY'
# print(" %s.%s (%s) --- %s" % (type(value).__name__, attr, tp_name, subvalue_type)) # print(" %s.%s (%s) --- %s" % (type(value).__name__, attr, tp_name, subvalue_type))
setattr(value, attr, value_xml_coerce) try:
setattr(value, attr, value_xml_coerce)
except ValueError:
# size mismatch
val = getattr(value, attr)
if len(val) < len(value_xml_coerce):
setattr(value, attr, value_xml_coerce[:len(val)])
else:
setattr(value, attr, list(value_xml_coerce) + list(val)[len(value_xml_coerce):])
# --------------------------------------------------------------------- # ---------------------------------------------------------------------
# Complex attributes # Complex attributes