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