Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 10fa94d

Browse files
committed
Fix warnings about math_symbol_table.py
svn path=/trunk/matplotlib/; revision=7805
1 parent ea4abac commit 10fa94d

1 file changed

Lines changed: 8 additions & 19 deletions

File tree

doc/sphinxext/math_symbol_table.py

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -128,25 +128,14 @@ def get_n(n, l):
128128
state_machine.insert_input(lines, "Symbol table")
129129
return []
130130

131-
try:
132-
from docutils.parsers.rst import Directive
133-
except ImportError:
134-
from docutils.parsers.rst.directives import _directives
135-
def math_symbol_table_directive(name, arguments, options, content, lineno,
136-
content_offset, block_text, state, state_machine):
137-
return run(state_machine)
138-
math_symbol_table_directive.arguments = None
139-
math_symbol_table_directive.options = {}
140-
math_symbol_table_directive.content = False
141-
_directives['math_symbol_table'] = math_symbol_table_directive
142-
else:
143-
class math_symbol_table_directive(Directive):
144-
has_content = False
145-
def run(self):
146-
return run(self.state_machine)
147-
from docutils.parsers.rst import directives
148-
directives.register_directive('math_symbol_table',
149-
math_symbol_table_directive)
131+
def math_symbol_table_directive(name, arguments, options, content, lineno,
132+
content_offset, block_text, state, state_machine):
133+
return run(state_machine)
134+
135+
def setup(app):
136+
app.add_directive(
137+
'math_symbol_table', math_symbol_table_directive,
138+
False, (0, 1, 0))
150139

151140
if __name__ == "__main__":
152141
# Do some verification of the tables

0 commit comments

Comments
 (0)