##// END OF EJS Templates
py3: make raise statement python3 compatible...
Pulkit Goyal -
r29158:7c0297bf default
parent child Browse files
Show More
@@ -415,7 +415,7 b' class Translator(nodes.NodeVisitor):'
415 else:
415 else:
416 self._docinfo[name] = node.astext()
416 self._docinfo[name] = node.astext()
417 self._docinfo_keys.append(name)
417 self._docinfo_keys.append(name)
418 raise nodes.SkipNode
418 raise nodes.SkipNode()
419
419
420 def depart_docinfo_item(self, node):
420 def depart_docinfo_item(self, node):
421 pass
421 pass
@@ -469,7 +469,7 b' class Translator(nodes.NodeVisitor):'
469
469
470 def visit_citation_reference(self, node):
470 def visit_citation_reference(self, node):
471 self.body.append('['+node.astext()+']')
471 self.body.append('['+node.astext()+']')
472 raise nodes.SkipNode
472 raise nodes.SkipNode()
473
473
474 def visit_classifier(self, node):
474 def visit_classifier(self, node):
475 pass
475 pass
@@ -489,7 +489,7 b' class Translator(nodes.NodeVisitor):'
489 def visit_comment(self, node,
489 def visit_comment(self, node,
490 sub=re.compile('-(?=-)').sub):
490 sub=re.compile('-(?=-)').sub):
491 self.body.append(self.comment(node.astext()))
491 self.body.append(self.comment(node.astext()))
492 raise nodes.SkipNode
492 raise nodes.SkipNode()
493
493
494 def visit_contact(self, node):
494 def visit_contact(self, node):
495 self.visit_docinfo_item(node, 'contact')
495 self.visit_docinfo_item(node, 'contact')
@@ -643,7 +643,7 b' class Translator(nodes.NodeVisitor):'
643 name_normalized = self._field_name.lower().replace(" ","_")
643 name_normalized = self._field_name.lower().replace(" ","_")
644 self._docinfo_names[name_normalized] = self._field_name
644 self._docinfo_names[name_normalized] = self._field_name
645 self.visit_docinfo_item(node, name_normalized)
645 self.visit_docinfo_item(node, name_normalized)
646 raise nodes.SkipNode
646 raise nodes.SkipNode()
647
647
648 def depart_field_body(self, node):
648 def depart_field_body(self, node):
649 pass
649 pass
@@ -657,7 +657,7 b' class Translator(nodes.NodeVisitor):'
657 def visit_field_name(self, node):
657 def visit_field_name(self, node):
658 if self._in_docinfo:
658 if self._in_docinfo:
659 self._field_name = node.astext()
659 self._field_name = node.astext()
660 raise nodes.SkipNode
660 raise nodes.SkipNode()
661 else:
661 else:
662 self.body.append(self.defs['field_name'][0])
662 self.body.append(self.defs['field_name'][0])
663
663
@@ -693,7 +693,7 b' class Translator(nodes.NodeVisitor):'
693
693
694 def visit_footnote_reference(self, node):
694 def visit_footnote_reference(self, node):
695 self.body.append('['+self.deunicode(node.astext())+']')
695 self.body.append('['+self.deunicode(node.astext())+']')
696 raise nodes.SkipNode
696 raise nodes.SkipNode()
697
697
698 def depart_footnote_reference(self, node):
698 def depart_footnote_reference(self, node):
699 pass
699 pass
@@ -705,7 +705,7 b' class Translator(nodes.NodeVisitor):'
705 pass
705 pass
706
706
707 def visit_header(self, node):
707 def visit_header(self, node):
708 raise NotImplementedError, node.astext()
708 raise NotImplementedError(node.astext())
709
709
710 def depart_header(self, node):
710 def depart_header(self, node):
711 pass
711 pass
@@ -742,7 +742,7 b' class Translator(nodes.NodeVisitor):'
742 if 'uri' in node.attributes:
742 if 'uri' in node.attributes:
743 text.append(node.attributes['uri'])
743 text.append(node.attributes['uri'])
744 self.body.append('[image: %s]\n' % ('/'.join(text)))
744 self.body.append('[image: %s]\n' % ('/'.join(text)))
745 raise nodes.SkipNode
745 raise nodes.SkipNode()
746
746
747 def visit_important(self, node):
747 def visit_important(self, node):
748 self.visit_admonition(node, 'important')
748 self.visit_admonition(node, 'important')
@@ -753,7 +753,7 b' class Translator(nodes.NodeVisitor):'
753 # footnote and citation
753 # footnote and citation
754 if (isinstance(node.parent, nodes.footnote)
754 if (isinstance(node.parent, nodes.footnote)
755 or isinstance(node.parent, nodes.citation)):
755 or isinstance(node.parent, nodes.citation)):
756 raise nodes.SkipNode
756 raise nodes.SkipNode()
757 self.document.reporter.warning('"unsupported "label"',
757 self.document.reporter.warning('"unsupported "label"',
758 base_node=node)
758 base_node=node)
759 self.body.append('[')
759 self.body.append('[')
@@ -814,7 +814,7 b' class Translator(nodes.NodeVisitor):'
814 self.body.append(self.defs['literal_block'][1])
814 self.body.append(self.defs['literal_block'][1])
815
815
816 def visit_meta(self, node):
816 def visit_meta(self, node):
817 raise NotImplementedError, node.astext()
817 raise NotImplementedError(node.astext())
818
818
819 def depart_meta(self, node):
819 def depart_meta(self, node):
820 pass
820 pass
@@ -924,7 +924,7 b' class Translator(nodes.NodeVisitor):'
924 if node.get('format') == 'manpage':
924 if node.get('format') == 'manpage':
925 self.body.append(node.astext() + "\n")
925 self.body.append(node.astext() + "\n")
926 # Keep non-manpage raw text out of output:
926 # Keep non-manpage raw text out of output:
927 raise nodes.SkipNode
927 raise nodes.SkipNode()
928
928
929 def visit_reference(self, node):
929 def visit_reference(self, node):
930 """E.g. link or email address."""
930 """E.g. link or email address."""
@@ -963,7 +963,7 b' class Translator(nodes.NodeVisitor):'
963
963
964 def visit_substitution_definition(self, node):
964 def visit_substitution_definition(self, node):
965 """Internal only."""
965 """Internal only."""
966 raise nodes.SkipNode
966 raise nodes.SkipNode()
967
967
968 def visit_substitution_reference(self, node):
968 def visit_substitution_reference(self, node):
969 self.document.reporter.warning('"substitution_reference" not supported',
969 self.document.reporter.warning('"substitution_reference" not supported',
@@ -1009,7 +1009,7 b' class Translator(nodes.NodeVisitor):'
1009
1009
1010 def visit_target(self, node):
1010 def visit_target(self, node):
1011 # targets are in-document hyper targets, without any use for man-pages.
1011 # targets are in-document hyper targets, without any use for man-pages.
1012 raise nodes.SkipNode
1012 raise nodes.SkipNode()
1013
1013
1014 def visit_tbody(self, node):
1014 def visit_tbody(self, node):
1015 pass
1015 pass
@@ -1053,7 +1053,7 b' class Translator(nodes.NodeVisitor):'
1053 self._docinfo['title'] = node.astext()
1053 self._docinfo['title'] = node.astext()
1054 # document title for .TH
1054 # document title for .TH
1055 self._docinfo['title_upper'] = node.astext().upper()
1055 self._docinfo['title_upper'] = node.astext().upper()
1056 raise nodes.SkipNode
1056 raise nodes.SkipNode()
1057 elif self.section_level == 1:
1057 elif self.section_level == 1:
1058 self.body.append('.SH ')
1058 self.body.append('.SH ')
1059 for n in node.traverse(nodes.Text):
1059 for n in node.traverse(nodes.Text):
General Comments 0
You need to be logged in to leave comments. Login now