-# -*- coding: utf-8 -*-
+# This file is part of FNP-Redakcja, licensed under GNU Affero GPLv3 or later.
+# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
+#
from copy import deepcopy
import re
master.insert(0, trim_tag)
trim_tag.tail = '\n\n\n' + (master.text or '')
master.text = '\n'
- return unicode(etree.tostring(e, encoding="utf-8"), 'utf-8')
+ return str(etree.tostring(e, encoding="utf-8"), 'utf-8')
def add_trim_end(text):
prev.tail = (prev.tail or '') + '\n\n\n'
else:
master.text = (master.text or '') + '\n\n\n'
- return unicode(etree.tostring(e, encoding="utf-8"), 'utf-8')
+ return str(etree.tostring(e, encoding="utf-8"), 'utf-8')
def split_xml(text):
del parent[0]
element, parent = parent, parent.getparent()
chunks[:0] = [[name,
- unicode(etree.tostring(copied, encoding='utf-8'), 'utf-8')
+ str(etree.tostring(copied, encoding='utf-8'), 'utf-8')
]]
parts = src.findall('.//naglowek_rozdzial')
chunks[:0] = [[u'początek',
- unicode(etree.tostring(src, encoding='utf-8'), 'utf-8')
+ str(etree.tostring(src, encoding='utf-8'), 'utf-8')
]]
for ch in chunks[1:]: