# HG changeset patch # User Paul Boddie # Date 1381685019 -7200 # Node ID 03b7f429c5d4b80ad0d0857e50e1fb43a25bf061 # Parent 19cd0e03f46dffe4acecf018be01a1554ccffb66 Imposed restrictions on target names for attributes from annotations. diff -r 19cd0e03f46d -r 03b7f429c5d4 micropython/report.py --- a/micropython/report.py Sun Oct 13 18:40:30 2013 +0200 +++ b/micropython/report.py Sun Oct 13 19:23:39 2013 +0200 @@ -429,14 +429,17 @@ return values def _attribute_value_to_name(self, attr, value, target=False): - if value and not isinstance(value, Instance): - fullname = value.full_name() - elif value and isinstance(value, Const): + 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 isinstance(attr.parent, Instance): - fullname = "%s%s" % (attr.parent_type.full_name(), not target and ".%s" % attr.name or "") + 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 "") else: - fullname = "%s%s" % (attr.parent.full_name(), not target and ".%s" % attr.name or "") + fullname = None return fullname def _attributes_to_target_names(self, attributes): @@ -448,7 +451,8 @@ if attributes: for attr, value in attributes: fullname = self._attribute_value_to_name(attr, value, True) - output.append(fullname) + if fullname: + output.append(fullname) output.sort() return output