summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2019-10-24 22:36:14 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2019-10-24 22:36:14 (GMT)
commit3cef70bcb2f8f7b3c003dada6c65f477aa1339e1 (patch)
tree9745b2c551f2f1ffb4b802589482f5bb13af06c7
parent77f093a9d3914100a1046f2875735aa9c3f8c9dd (diff)
downloadmisc-fred-3cef70bcb2f8f7b3c003dada6c65f477aa1339e1.zip
misc-fred-3cef70bcb2f8f7b3c003dada6c65f477aa1339e1.tar.gz
misc-fred-3cef70bcb2f8f7b3c003dada6c65f477aa1339e1.tar.bz2
doc-publik: update mallard conversion script to python 3
-rw-r--r--doc-publik/update-publik-doc-from-mallard.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/doc-publik/update-publik-doc-from-mallard.py b/doc-publik/update-publik-doc-from-mallard.py
index 1ddfac8..2d9eff4 100644
--- a/doc-publik/update-publik-doc-from-mallard.py
+++ b/doc-publik/update-publik-doc-from-mallard.py
@@ -32,6 +32,7 @@ for cell in TextCell.objects.filter(slug__startswith='mallard-'):
for img in document.find_all('img'):
img.attrs['src'] = 'https://doc.entrouvert.org/%s/dev/%s' % (module, img.attrs['src'])
- new_content = unicode(content).replace(unicode(more_info), '')
- cell.text = new_content
- cell.save()
+ if more_info:
+ new_content = content.decode().replace(more_info.decode(), '')
+ cell.text = new_content
+ cell.save()