Jon Waltman avatar Jon Waltman committed f3758d8

Use builder.warn instead of document.reporter.* in Texinfo.

Comments (0)

Files changed (1)

sphinx/writers/texinfo.py

             # Handle xrefs with missing anchors
             r = self.referenced_ids.pop()
             if r not in self.written_ids:
-                self.document.reporter.info(
-                    "Unknown cross-reference target: `%s'" % r)
+                self.builder.warn("missing cross-reference target: %r" % r)
                 self.add_text('@anchor{%s}@w{%s}\n' % (r, ' ' * 30))
         self.fragment = ''.join(self.body).strip() + '\n'
         self.elements['body'] = self.fragment
         elif isinstance(parent, nodes.topic):
             raise nodes.SkipNode
         elif not isinstance(parent, nodes.section):
-            self.document.reporter.warning(
+            self.builder.warn(
                 'encountered title node not in section, topic, table, '
-                'admonition or sidebar', base_node=node)
+                'admonition or sidebar', (self.curfilestack[-1], node.line))
             self.visit_rubric(node)
         else:
             try:
         elif node.get('refuri'):
             pass
         else:
-            self.document.reporter.error("Unknown target type: %r" % node)
+            self.builder.warn("unknown target type: %r" % node,
+                              (self.curfilestack[-1], node.line))
 
     def visit_reference(self, node):
         if isinstance(node.parent, nodes.title):
             self.add_xref(node['refid'], name, node)
             raise nodes.SkipNode
         if not node.get('refuri'):
-            self.document.reporter.error("Unknown reference type: %s" % node)
+            self.builder.warn("unknown reference type: %s" % node,
+                              (self.curfilestack[-1], node.line))
             return
         uri = node['refuri']
         if uri.startswith('#'):
 
     def visit_caption(self, node):
         if not isinstance(node.parent, nodes.figure):
-            self.document.reporter.warning('Caption not inside a figure.',
-                                           base_node=node)
+            self.builder.warn('caption not inside a figure.',
+                              (self.curfilestack[-1], node.line))
             return
         self.add_text('@caption{', fresh=1)
     def depart_caption(self, node):
         self.add_text('<')
 
     def unimplemented_visit(self, node):
-        self.document.reporter.error("Unimplemented node type: `%s'"
-                                     % node.__class__.__name__, base_node=node)
+        self.builder.warn("unimplemented node type: %r" % node,
+                          (self.curfilestack[-1], node.line))
 
     def unknown_visit(self, node):
-        self.document.reporter.error("Unknown node type: `%s'"
-                                     % node.__class__.__name__, base_node=node)
+        self.builder.warn("Unknown node type: %r" % node,
+                          (self.curfilestack[-1], node.line))
     def unknown_departure(self, node):
         pass
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.