# HG changeset patch # User Paul Boddie # Date 1342304085 -7200 # Node ID 0bcb66c8b6e2069c13acf85ceda39895f82d8902 # Parent 2ee8f1875f2c75a46ebf494255ea514f8128e2ce Show only distinct attribute name lists when showing attribute usage for names. diff -r 2ee8f1875f2c -r 0bcb66c8b6e2 micropython/report.py --- a/micropython/report.py Sat Jul 14 23:49:43 2012 +0200 +++ b/micropython/report.py Sun Jul 15 00:14:45 2012 +0200 @@ -346,16 +346,26 @@ def _attrcombined(self, name, node): attrcombined = node._attrcombined and node._attrcombined.get(name) or [] - for attrnames in attrcombined: - if attrnames: - break - else: + # Since assigned values will not be shown, produce a sorted list of + # distinct attribute name lists. + + all_attrnames = set() + for usage in attrcombined: + if usage: + all_attrnames.add(tuple(usage.keys())) + + if not all_attrnames: return False + all_attrnames = list(all_attrnames) + all_attrnames.sort() + + # Write the lists of attribute names. + self._name_start() self.stream.write(name) self._popup_start() - for attrnames in attrcombined: + for attrnames in all_attrnames: self._attrnames(attrnames) self._popup_end() self._name_end()