# HG changeset patch # User Paul Boddie # Date 1282502086 -7200 # Node ID 40bdd4e5f0f2b649d6035e2a4ab44bcc946f92c5 # Parent 931a9f0b8bde98ca1c74d797980cd517fd59b371 Fixed pop-up elements where no type suggestions exist. Fixed attribute labels for strict constant class attributes. Added trailing spaces after some keywords. diff -r 931a9f0b8bde -r 40bdd4e5f0f2 micropython/report.py --- a/micropython/report.py Sat Aug 21 03:05:26 2010 +0200 +++ b/micropython/report.py Sun Aug 22 20:34:46 2010 +0200 @@ -229,14 +229,15 @@ self._summary_link(module.full_name(), obj.full_name(), obj.name, classes) - def _object_name_ref(self, module, obj, classes=None): + def _object_name_ref(self, module, obj, name=None, classes=None): """ - Link to the definition for 'module' using 'obj'. The optional 'classes' + Link to the definition for 'module' using 'obj' with the optional 'name' + used as the label (instead of the name of 'obj'). The optional 'classes' can be used to customise the CSS classes employed. """ - self._name_link(module.full_name(), obj.full_name(), obj.name, classes) + self._name_link(module.full_name(), obj.full_name(), name or obj.name, classes) def _summary_link(self, module_name, full_name, name, classes=None): self._name_link("%s-summary" % module_name, full_name, name, classes) @@ -285,14 +286,14 @@ self._names_list(typenames, "types", "typenames") def _accessor_start(self, target_names): - if target_names is not None: + if target_names: self._span_start("accessor") self._popup_start("types-popup") self._typenames(target_names) self._popup_end() def _accessor_end(self, target_names): - if target_names is not None: + if target_names: self._span_end() # Summary classes. @@ -373,7 +374,7 @@ if attr.is_strict_constant(): value = attr.get_value() self.stream.write("" % self._attr(value.full_name())) - self._object_name_ref(self.module, value, classes="summary-ref") + self._object_name_ref(self.module, value, attr.name, classes="summary-ref") self.stream.write("\n") else: self.stream.write("%s\n" % self._text(attr.name)) @@ -921,7 +922,7 @@ def visitListCompFor(self, node): self._span_start("listcompfor") - self._keyword("for") + self._keyword("for", 1) self._span_start("item") self.dispatch(node.assign) self._span_end()