本文整理匯總了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'])