# HG changeset patch # User Paul Boddie # Date 1381686291 -7200 # Node ID 50bdb7ef27eae538e8b0b13c049fe656c5fbac4d # Parent 03b7f429c5d4b80ad0d0857e50e1fb43a25bf061 Attempted to provide more reasonable target type details, preferring attribute parents over value information. diff -r 03b7f429c5d4 -r 50bdb7ef27ea micropython/report.py --- a/micropython/report.py Sun Oct 13 19:23:39 2013 +0200 +++ b/micropython/report.py Sun Oct 13 19:44:51 2013 +0200 @@ -429,17 +429,26 @@ return values def _attribute_value_to_name(self, attr, value, target=False): - if value and not isinstance(value, Instance) and (not target or value.parent): - fullname = target and value.parent and value.parent.full_name() or value.full_name() - elif value and isinstance(value, Const) and not target: - fullname = "%s" % value.get_value() - elif attr: - if isinstance(attr.parent, Instance): - fullname = "%s%s" % (attr.parent_type.full_name(), not target and ".%s" % attr.name or "") - else: - fullname = "%s%s" % (attr.parent.full_name(), not target and ".%s" % attr.name or "") + fullname = None + if target: + if attr: + if isinstance(attr.parent, Instance): + fullname = attr.parent_type.full_name() + else: + fullname = attr.parent.full_name() + elif value and not isinstance(value, Instance) and value.parent: + fullname = value.parent.full_name() else: - fullname = None + if value and not isinstance(value, Instance): + fullname = value.full_name() + elif value and isinstance(value, Const): + fullname = "%s" % value.get_value() + elif attr: + if isinstance(attr.parent, Instance): + fullname = "%s.%s" % (attr.parent_type.full_name(), attr.name) + else: + fullname = "%s.%s" % (attr.parent.full_name(), attr.name) + return fullname def _attributes_to_target_names(self, attributes):