本文整理汇总了Python中docutils.parsers.rst.directives._directives方法的典型用法代码示例。如果您正苦于以下问题:Python directives._directives方法的具体用法?Python directives._directives怎么用?Python directives._directives使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类docutils.parsers.rst.directives
的用法示例。
在下文中一共展示了directives._directives方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
# 需要导入模块: from docutils.parsers.rst import directives [as 别名]
# 或者: from docutils.parsers.rst.directives import _directives [as 别名]
def run(self):
automodule = directives._directives["automodule"]
options = dict.fromkeys(('inherited-members', 'members', 'undoc-members'))
message_module = "olympe.messages." + self.arguments[0]
enum_module = "olympe.enums." + self.arguments[0]
result = automodule("automodule", [message_module], options, *self.directive_args).run()
result += automodule("automodule", [enum_module], options, *self.directive_args).run()
return result
示例2: setUp
# 需要导入模块: from docutils.parsers.rst import directives [as 别名]
# 或者: from docutils.parsers.rst.directives import _directives [as 别名]
def setUp(self):
# Avoid "WARNING: while setting up extension
# sphinxcontrib.programoutput: directive u'program-output' is
# already registered, it will be overridden".
# This may only be needed for Sphinx 1.
self.directives = directives._directives.copy()
# Likewise for 'eq'
self.roles = roles._roles.copy()
# Avoid "node class 'toctree' is already registered, its visitors will be overridden"
# By default this class has *no* `visit_` methods
for node in self.duplicate_nodes_to_remove:
if hasattr(nodes.GenericNodeVisitor, 'visit_' + node):
delattr(nodes.GenericNodeVisitor, 'visit_' + node)
示例3: tearDown
# 需要导入模块: from docutils.parsers.rst import directives [as 别名]
# 或者: from docutils.parsers.rst.directives import _directives [as 别名]
def tearDown(self):
directives._directives = self.directives
roles._roles = self.roles
示例4: tearDown
# 需要导入模块: from docutils.parsers.rst import directives [as 别名]
# 或者: from docutils.parsers.rst.directives import _directives [as 别名]
def tearDown(self):
if 'rackdiag' in docutils._directives:
del docutils._directives['rackdiag']
self._tmpdir.clean()
示例5: test_setup
# 需要导入模块: from docutils.parsers.rst import directives [as 别名]
# 或者: from docutils.parsers.rst.directives import _directives [as 别名]
def test_setup(self):
directives.setup()
options = directives.directive_options
self.assertIn('rackdiag', docutils._directives)
self.assertEqual(directives.RackdiagDirective,
docutils._directives['rackdiag'])
self.assertEqual('PNG', options['format'])
self.assertEqual(False, options['antialias'])
self.assertEqual(None, options['fontpath'])
self.assertEqual(False, options['nodoctype'])
self.assertEqual(False, options['noviewbox'])
self.assertEqual(False, options['inline_svg'])
示例6: test_setup_with_args
# 需要导入模块: from docutils.parsers.rst import directives [as 别名]
# 或者: from docutils.parsers.rst.directives import _directives [as 别名]
def test_setup_with_args(self):
directives.setup(format='SVG', antialias=True, fontpath='/dev/null',
nodoctype=True, noviewbox=True, inline_svg=True)
options = directives.directive_options
self.assertIn('rackdiag', docutils._directives)
self.assertEqual(directives.RackdiagDirective,
docutils._directives['rackdiag'])
self.assertEqual('SVG', options['format'])
self.assertEqual(True, options['antialias'])
self.assertEqual('/dev/null', options['fontpath'])
self.assertEqual(True, options['nodoctype'])
self.assertEqual(True, options['noviewbox'])
self.assertEqual(True, options['inline_svg'])
示例7: tearDown
# 需要导入模块: from docutils.parsers.rst import directives [as 别名]
# 或者: from docutils.parsers.rst.directives import _directives [as 别名]
def tearDown(self):
if 'packetdiag' in docutils._directives:
del docutils._directives['packetdiag']
self._tmpdir.clean()
示例8: test_setup
# 需要导入模块: from docutils.parsers.rst import directives [as 别名]
# 或者: from docutils.parsers.rst.directives import _directives [as 别名]
def test_setup(self):
directives.setup()
options = directives.directive_options
self.assertIn('packetdiag', docutils._directives)
self.assertEqual(directives.PacketdiagDirective,
docutils._directives['packetdiag'])
self.assertEqual('PNG', options['format'])
self.assertEqual(False, options['antialias'])
self.assertEqual(None, options['fontpath'])
self.assertEqual(False, options['nodoctype'])
self.assertEqual(False, options['noviewbox'])
self.assertEqual(False, options['inline_svg'])
示例9: tearDown
# 需要导入模块: from docutils.parsers.rst import directives [as 别名]
# 或者: from docutils.parsers.rst.directives import _directives [as 别名]
def tearDown(self):
if 'nwdiag' in docutils._directives:
del docutils._directives['nwdiag']
self._tmpdir.clean()
示例10: test_setup
# 需要导入模块: from docutils.parsers.rst import directives [as 别名]
# 或者: from docutils.parsers.rst.directives import _directives [as 别名]
def test_setup(self):
directives.setup()
options = directives.directive_options
self.assertIn('nwdiag', docutils._directives)
self.assertEqual(directives.NwdiagDirective,
docutils._directives['nwdiag'])
self.assertEqual('PNG', options['format'])
self.assertEqual(False, options['antialias'])
self.assertEqual(None, options['fontpath'])
self.assertEqual(False, options['nodoctype'])
self.assertEqual(False, options['noviewbox'])
self.assertEqual(False, options['inline_svg'])
示例11: test_setup_with_args
# 需要导入模块: from docutils.parsers.rst import directives [as 别名]
# 或者: from docutils.parsers.rst.directives import _directives [as 别名]
def test_setup_with_args(self):
directives.setup(format='SVG', antialias=True, fontpath='/dev/null',
nodoctype=True, noviewbox=True, inline_svg=True)
options = directives.directive_options
self.assertIn('nwdiag', docutils._directives)
self.assertEqual(directives.NwdiagDirective,
docutils._directives['nwdiag'])
self.assertEqual('SVG', options['format'])
self.assertEqual(True, options['antialias'])
self.assertEqual('/dev/null', options['fontpath'])
self.assertEqual(True, options['nodoctype'])
self.assertEqual(True, options['noviewbox'])
self.assertEqual(True, options['inline_svg'])
示例12: _add_directive
# 需要导入模块: from docutils.parsers.rst import directives [as 别名]
# 或者: from docutils.parsers.rst.directives import _directives [as 别名]
def _add_directive(app, name, cls):
# check based on similar check in Sphinx().add_directive
if name not in directives._directives: # pylint: disable=protected-access
app.add_directive(name, cls)
示例13: tearDown
# 需要导入模块: from docutils.parsers.rst import directives [as 别名]
# 或者: from docutils.parsers.rst.directives import _directives [as 别名]
def tearDown(self):
if 'blockdiag' in docutils._directives:
del docutils._directives['blockdiag']
self._tmpdir.clean()
示例14: test_setup
# 需要导入模块: from docutils.parsers.rst import directives [as 别名]
# 或者: from docutils.parsers.rst.directives import _directives [as 别名]
def test_setup(self):
directives.setup()
options = directives.directive_options
self.assertIn('blockdiag', docutils._directives)
self.assertEqual(directives.BlockdiagDirective,
docutils._directives['blockdiag'])
self.assertEqual('PNG', options['format'])
self.assertEqual(False, options['antialias'])
self.assertEqual(None, options['fontpath'])
self.assertEqual(False, options['nodoctype'])
self.assertEqual(False, options['noviewbox'])
self.assertEqual(False, options['inline_svg'])
示例15: test_setup_with_args
# 需要导入模块: from docutils.parsers.rst import directives [as 别名]
# 或者: from docutils.parsers.rst.directives import _directives [as 别名]
def test_setup_with_args(self):
directives.setup(format='SVG', antialias=True, fontpath='/dev/null',
nodoctype=True, noviewbox=True, inline_svg=True)
options = directives.directive_options
self.assertIn('blockdiag', docutils._directives)
self.assertEqual(directives.BlockdiagDirective,
docutils._directives['blockdiag'])
self.assertEqual('SVG', options['format'])
self.assertEqual(True, options['antialias'])
self.assertEqual('/dev/null', options['fontpath'])
self.assertEqual(True, options['nodoctype'])
self.assertEqual(True, options['noviewbox'])
self.assertEqual(True, options['inline_svg'])