changeset 5729:4507be75514a

googleimport: get rid of line anchors and lineXXX class attrs
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 20 Nov 2010 20:57:38 +0100
parents bbfe34d68e6c
children d70b5147ef0b
files contrib/googleimport/driver.py
diffstat 1 files changed, 14 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/googleimport/driver.py	Sat Nov 20 20:34:06 2010 +0100
+++ b/contrib/googleimport/driver.py	Sat Nov 20 20:57:38 2010 +0100
@@ -18,6 +18,10 @@
 from MoinMoin.web.contexts import ScriptContext
 from MoinMoin.Page import Page
 
+# monkeypatch the formatter to avoid line_anchors:
+from MoinMoin.formatter import text_html
+text_html.line_anchors = False
+
 request = ScriptContext(None, None)
 
 
@@ -35,7 +39,16 @@
 
         page = Page(request, "")
         page.set_raw_body(desc)
-        self.desc = request.redirectedOutput(page.send_page, content_only=1).replace("\n", " ")
+        desc = request.redirectedOutput(page.send_page, content_only=1)
+        for s, r in [
+                ('\n', ' '),
+                (' class="line862"', ''),
+                (' class="line867"', ''),
+                (' class="line874"', ''),
+                (' class="line891"', ''),
+            ]:
+            desc = desc.replace(s, r)
+        self.desc = desc
 
     def __repr__(self):
         return (u"<Task summary=%r label=%r hours=%i mentors=%r difficulty=%r types=%r desc='''%s'''>" % (