本文整理汇总了Python中docutils.nodes.GenericNodeVisitor方法的典型用法代码示例。如果您正苦于以下问题:Python nodes.GenericNodeVisitor方法的具体用法?Python nodes.GenericNodeVisitor怎么用?Python nodes.GenericNodeVisitor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类docutils.nodes
的用法示例。
在下文中一共展示了nodes.GenericNodeVisitor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: dispatch_visit
# 需要导入模块: from docutils import nodes [as 别名]
# 或者: from docutils.nodes import GenericNodeVisitor [as 别名]
def dispatch_visit(self, node):
"""Override to catch basic attributes which many nodes have."""
self.handle_basic_atts(node)
nodes.GenericNodeVisitor.dispatch_visit(self, node)
示例2: setUp
# 需要导入模块: from docutils import nodes [as 别名]
# 或者: from docutils.nodes import GenericNodeVisitor [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)