[Pywikipedia-l] SVN: [4896] trunk/pywikipedia/wikipedia.py

cosoleto at svn.wikimedia.org cosoleto at svn.wikimedia.org
Wed Jan 16 08:26:42 UTC 2008


Revision: 4896
Author:   cosoleto
Date:     2008-01-16 08:26:42 +0000 (Wed, 16 Jan 2008)

Log Message:
-----------
fixed bug #1871586

Modified Paths:
--------------
    trunk/pywikipedia/wikipedia.py

Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py	2008-01-15 22:25:38 UTC (rev 4895)
+++ trunk/pywikipedia/wikipedia.py	2008-01-16 08:26:42 UTC (rev 4896)
@@ -3047,11 +3047,9 @@
         return text
     # This regular expression will find every interwiki link, plus trailing
     # whitespace.
-    validLinks = site.validLanguageLinks()
-    validLinks.extend(site.family.obsolete.keys())
-    languageR = '|'.join(validLinks)
+    languages = '|'.join(site.validLanguageLinks() + site.family.obsolete.keys())
     interwikiR = re.compile(r'\[\[(%s)\s?:[^\]]*\]\][\s]*'
-                            % languageR, re.IGNORECASE)
+                            % languages, re.IGNORECASE)
     text = replaceExcept(text, interwikiR, '',
                          ['nowiki', 'comment', 'math', 'pre', 'source'], marker=marker)
     return text.strip()





More information about the Pywikipedia-l mailing list