當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。