本文整理汇总了Python中sdoc.sdoc2.NodeStore.NodeStore.error方法的典型用法代码示例。如果您正苦于以下问题:Python NodeStore.error方法的具体用法?Python NodeStore.error怎么用?Python NodeStore.error使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sdoc.sdoc2.NodeStore.NodeStore
的用法示例。
在下文中一共展示了NodeStore.error方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: set_numbering
# 需要导入模块: from sdoc.sdoc2.NodeStore import NodeStore [as 别名]
# 或者: from sdoc.sdoc2.NodeStore.NodeStore import error [as 别名]
def set_numbering(self):
"""
Sets the numbering status to the heading node.
"""
if 'numbering' in self._options:
if self._options['numbering'] == 'off':
self.numbering = False
elif self._options['numbering'] == 'on':
self.numbering = True
else:
NodeStore.error("Invalid value '{}' for attribute 'numbering'. Allowed values are 'on' and 'off'.".
format(self._options['numbering']), self)
示例2: __check_document_info
# 需要导入模块: from sdoc.sdoc2.NodeStore import NodeStore [as 别名]
# 或者: from sdoc.sdoc2.NodeStore.NodeStore import error [as 别名]
def __check_document_info(info_node_current, info_node_new):
"""
Checks if a document info node has been set already. If so, an error will be logged.
:param int|None info_node_current: The current document info node (i.e. a property of the document).
:param sdoc.sdoc2.node.Node.Node info_node_new: The (new) document info node.
"""
if info_node_current:
node = in_scope(info_node_current)
position = node.position
out_scope(node)
NodeStore.error("Document info {0} can be specified only once. Previous definition at {1}.".format(
info_node_new.name, str(position)), info_node_new)
示例3: generate
# 需要导入模块: from sdoc.sdoc2.NodeStore import NodeStore [as 别名]
# 或者: from sdoc.sdoc2.NodeStore.NodeStore import error [as 别名]
def generate(self, node, file):
"""
Generates the HTML code for an icon node.
:param sdoc.sdoc2.node.IconNode.IconNode node: The icon node.
:param file file: The output file.
"""
attributes = IconNode.get_definition(node.argument)
if attributes:
img_element = Html.generate_void_element('img', attributes)
file.write(img_element)
else:
NodeStore.error("There is no definition for icon with name '{}'".format(node.argument), node)