summaryrefslogtreecommitdiffstats
path: root/doc-publik/update-publik-doc-from-redmine.py
diff options
context:
space:
mode:
Diffstat (limited to 'doc-publik/update-publik-doc-from-redmine.py')
-rw-r--r--doc-publik/update-publik-doc-from-redmine.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/doc-publik/update-publik-doc-from-redmine.py b/doc-publik/update-publik-doc-from-redmine.py
new file mode 100644
index 0000000..01c1a11
--- /dev/null
+++ b/doc-publik/update-publik-doc-from-redmine.py
@@ -0,0 +1,21 @@
+from bs4 import BeautifulSoup
+import html5lib
+import requests
+
+from combo.data.models import TextCell
+
+DOCS = {
+ 'passerelle-connecteur-dev': "https://dev.entrouvert.org/projects/passerelle/wiki/D%C3%A9veloppement_d'un_connecteur.html",
+}
+
+for cell in TextCell.objects.all():
+ if not cell.slug in DOCS:
+ continue
+ resp = requests.get(DOCS[cell.slug])
+ if resp.status_code != 200:
+ continue
+ document = BeautifulSoup(resp.content, 'html5lib')
+ content = document.find('body')
+ new_content = unicode(content).replace('<body>', '').replace('</body>', '')
+ cell.text = new_content
+ cell.save()