def paragraph(self, on, **kw): FormatterBase.paragraph(self, on) if on: self.paragraph_begin() else: self.paragraph_end() return ''
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()
def paragraph(self, on, **kw): FormatterBase.paragraph(self, on) if on: self.paragraph_begin() else: self.paragraph_end() return ''
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()
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()
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)
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)
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)
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)
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 ''
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 ''
def paragraph(self, on, **kw): FormatterBase.paragraph(self, on) return self._set_tag('p', on)
def paragraph(self, on, **kw): FormatterBase.paragraph(self, on) return self.write_text(['', '\n\n'][not on])
def paragraph(self, on, **kw): FormatterBase.paragraph(self, on) self._elem(u"p", on) return ""
def paragraph(self, on, **kw): FormatterBase.paragraph(self, on) return self._set_tag('p', on)
def paragraph(self, on, **kw): FormatterBase.paragraph(self, on) return ['<p>', '</p>\n'][not on]
def paragraph(self, on, **kw): FormatterBase.paragraph(self, on) if self._did_para: on = 0 return [u'\n', u''][not on]
def paragraph(self, on, **kw): FormatterBase.paragraph(self, on) if self.in_table or self.list_depth: return '' return ['', '\n\n'][not on]
def paragraph(self, on, **kw): FormatterBase.paragraph(self, on) self._elem(u'p', on) return ''
def paragraph(self, on, **kw): FormatterBase.paragraph(self, on) if self.in_table or self.list_depth: return '' return ['', '\n\n'][not on]