[Pywikipedia-l] SVN: [5401] trunk/pywikipedia/wikipedia.py
nicdumz at svn.wikimedia.org
nicdumz at svn.wikimedia.org
Sun May 18 19:17:39 UTC 2008
Revision: 5401
Author: nicdumz
Date: 2008-05-18 19:17:39 +0000 (Sun, 18 May 2008)
Log Message:
-----------
dummy #redirect[[]] plague, bis. (Undoing last commit, using a proper fix.)
Modified Paths:
--------------
trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py 2008-05-18 19:09:01 UTC (rev 5400)
+++ trunk/pywikipedia/wikipedia.py 2008-05-18 19:17:39 UTC (rev 5401)
@@ -792,12 +792,10 @@
redirtarget = "%s#%s" % (m.group(1), self.section())
else:
redirtarget = m.group(1)
- #avoid dummy #REDIRECT[[]]
- if redirtarget:
- if get_redirect:
- self._redirarg = redirtarget
- elif not nofollow_redirects:
- raise IsRedirectPage(redirtarget)
+ if get_redirect:
+ self._redirarg = redirtarget
+ elif not nofollow_redirects:
+ raise IsRedirectPage(redirtarget)
if self.section():
# TODO: What the hell is this? Docu please.
m = re.search("\.3D\_*(\.27\.27+)?(\.5B\.5B)?\_*%s\_*(\.5B\.5B)?(\.27\.27+)?\_*\.3D" % re.escape(self.section()), sectionencode(text,self.site().encoding()))
@@ -5119,7 +5117,7 @@
# a label, although this is not useful.
return re.compile(r'#' + redirKeywordsR +
- '.*?\[\[(.*?)(?:\|.*?)?\]\]',
+ '.*?\[\[(.+?)(?:\|.*?)?\]\]',
re.IGNORECASE | re.UNICODE | re.DOTALL)
# The following methods are for convenience, so that you can access
More information about the Pywikipedia-l
mailing list