当前位置: 首页>>代码示例>>Python>>正文


Python directives._directives方法代码示例

本文整理汇总了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 
开发者ID:Parrot-Developers,项目名称:olympe,代码行数:10,代码来源:sphinx_doc.py

示例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) 
开发者ID:NextThought,项目名称:sphinxcontrib-programoutput,代码行数:16,代码来源:__init__.py

示例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 
开发者ID:NextThought,项目名称:sphinxcontrib-programoutput,代码行数:5,代码来源:__init__.py

示例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() 
开发者ID:blockdiag,项目名称:nwdiag,代码行数:7,代码来源:test_rst_directives.py

示例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']) 
开发者ID:blockdiag,项目名称:nwdiag,代码行数:15,代码来源:test_rst_directives.py

示例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']) 
开发者ID:blockdiag,项目名称:nwdiag,代码行数:16,代码来源:test_rst_directives.py

示例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() 
开发者ID:blockdiag,项目名称:nwdiag,代码行数:7,代码来源:test_rst_directives.py

示例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']) 
开发者ID:blockdiag,项目名称:nwdiag,代码行数:15,代码来源:test_rst_directives.py

示例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() 
开发者ID:blockdiag,项目名称:nwdiag,代码行数:7,代码来源:test_rst_directives.py

示例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']) 
开发者ID:blockdiag,项目名称:nwdiag,代码行数:15,代码来源:test_rst_directives.py

示例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']) 
开发者ID:blockdiag,项目名称:nwdiag,代码行数:16,代码来源:test_rst_directives.py

示例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) 
开发者ID:Azure,项目名称:azure-cli-dev-tools,代码行数:6,代码来源:directives.py

示例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() 
开发者ID:blockdiag,项目名称:blockdiag,代码行数:7,代码来源:test_blockdiag_directives.py

示例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']) 
开发者ID:blockdiag,项目名称:blockdiag,代码行数:15,代码来源:test_blockdiag_directives.py

示例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']) 
开发者ID:blockdiag,项目名称:blockdiag,代码行数:16,代码来源:test_blockdiag_directives.py


注:本文中的docutils.parsers.rst.directives._directives方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。