本文整理汇总了Python中MoinMoin.formatter.FormatterBase.paragraph方法的典型用法代码示例。如果您正苦于以下问题:Python FormatterBase.paragraph方法的具体用法?Python FormatterBase.paragraph怎么用?Python FormatterBase.paragraph使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MoinMoin.formatter.FormatterBase
的用法示例。
在下文中一共展示了FormatterBase.paragraph方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: paragraph
# 需要导入模块: from MoinMoin.formatter import FormatterBase [as 别名]
# 或者: from MoinMoin.formatter.FormatterBase import paragraph [as 别名]
def paragraph(self, on, **kw):
# Maintain the accessible flag `in_p`
FormatterBase.paragraph(self, on)
if on:
return self._output()
else:
return self._output_EOL_BLK()
示例2: paragraph
# 需要导入模块: from MoinMoin.formatter import FormatterBase [as 别名]
# 或者: from MoinMoin.formatter.FormatterBase import paragraph [as 别名]
def paragraph(self, on, **kw):
FormatterBase.paragraph(self, on)
if on:
self.paragraph_begin()
else:
self.paragraph_end()
return ''
示例3: _close_tag
# 需要导入模块: from MoinMoin.formatter import FormatterBase [as 别名]
# 或者: from MoinMoin.formatter.FormatterBase import paragraph [as 别名]
def _close_tag(self, tag):
""" low level function: closes tag right now
must be the last opened tag!!!
"""
if tag == 'p':
FormatterBase.paragraph(self, 0)
if self.tag_stack[-1][0] != tag:
raise ValueError, "closing of <%s> expected, but <%s> closed" % (self.tag_stack[-1][0], tag)
self.position = self.position.parentNode
return self.tag_stack.pop()
示例4: paragraph
# 需要导入模块: from MoinMoin.formatter import FormatterBase [as 别名]
# 或者: from MoinMoin.formatter.FormatterBase import paragraph [as 别名]
def paragraph(self, on, **kw):
FormatterBase.paragraph(self, on)
# Let's prevent empty paras
if not on:
if not self._hasContent(self.cur):
oldnode = self.cur
self.cur = oldnode.parentNode
self.cur.removeChild(oldnode)
return ""
# Let's prevent para inside para
if on and self.cur.nodeName == "para":
return ""
return self._handleNode("para", on)
示例5: paragraph
# 需要导入模块: from MoinMoin.formatter import FormatterBase [as 别名]
# 或者: from MoinMoin.formatter.FormatterBase import paragraph [as 别名]
def paragraph(self, on, **kw):
FormatterBase.paragraph(self, on)
# Let's prevent empty paras
if not on:
if not self._hasContent(self.cur):
oldnode = self.cur
self.cur = oldnode.xml_parent
self.cur.xml_remove(oldnode)
return ""
# Let's prevent para inside para
if on and self.cur.xml_qname == u"para":
return ""
return self._handleNode(u"para", on)
示例6: _open_tag
# 需要导入模块: from MoinMoin.formatter import FormatterBase [as 别名]
# 或者: from MoinMoin.formatter.FormatterBase import paragraph [as 别名]
def _open_tag(self, tag, **attrs):
""" low level function: opens tag right now
@param tag: tag name, string
@param attrs: attributes keywords, ascii or unicode
"""
if tag == 'p':
FormatterBase.paragraph(self, 1)
self.tag_stack.append((tag, attrs))
node = self.document.createElement(tag)
for name, value in attrs.items():
if value:
node.setAttribute(name, unicode(value))
self.position.appendChild(node)
self.position = node
return ''
示例7: paragraph
# 需要导入模块: from MoinMoin.formatter import FormatterBase [as 别名]
# 或者: from MoinMoin.formatter.FormatterBase import paragraph [as 别名]
def paragraph(self, on, **kw):
FormatterBase.paragraph(self, on)
self._elem(u"p", on)
return ""
示例8: paragraph
# 需要导入模块: from MoinMoin.formatter import FormatterBase [as 别名]
# 或者: from MoinMoin.formatter.FormatterBase import paragraph [as 别名]
def paragraph(self, on, **kw):
FormatterBase.paragraph(self, on)
return self._set_tag('p', on)
示例9: paragraph
# 需要导入模块: from MoinMoin.formatter import FormatterBase [as 别名]
# 或者: from MoinMoin.formatter.FormatterBase import paragraph [as 别名]
def paragraph(self, on, **kw):
FormatterBase.paragraph(self, on)
return ['<p>', '</p>\n'][not on]
示例10: paragraph
# 需要导入模块: from MoinMoin.formatter import FormatterBase [as 别名]
# 或者: from MoinMoin.formatter.FormatterBase import paragraph [as 别名]
def paragraph(self, on, **kw):
FormatterBase.paragraph(self, on)
if self._did_para:
on = 0
return [u'\n', u''][not on]
示例11: paragraph
# 需要导入模块: from MoinMoin.formatter import FormatterBase [as 别名]
# 或者: from MoinMoin.formatter.FormatterBase import paragraph [as 别名]
def paragraph(self, on, **kw):
FormatterBase.paragraph(self, on)
return self.write_text(['', '\n\n'][not on])
示例12: paragraph
# 需要导入模块: from MoinMoin.formatter import FormatterBase [as 别名]
# 或者: from MoinMoin.formatter.FormatterBase import paragraph [as 别名]
def paragraph(self, on, **kw):
FormatterBase.paragraph(self, on)
if self.in_table or self.list_depth:
return ''
return ['', '\n\n'][not on]