Revision: 4968 Author: filnik Date: 2008-02-03 21:21:24 +0000 (Sun, 03 Feb 2008)
Log Message: ----------- fix
Modified Paths: -------------- trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2008-02-03 21:01:24 UTC (rev 4967) +++ trunk/pywikipedia/wikipedia.py 2008-02-03 21:21:24 UTC (rev 4968) @@ -4714,11 +4714,18 @@ if self.lang == 'ar': red = u"تحويل" try: - redirKeywords = [red] + self.family.redirect[self.lang] - redirKeywordsR = r'(?:' + redDefault + '|'.join(redirKeywords) + ')' + if redDefault == red: + redirKeywords = [red] + self.family.redirect[self.lang] + redirKeywordsR = r'(?:' + '|'.join(redirKeywords) + ')' + else: + redirKeywords = [red] + self.family.redirect[self.lang] + redirKeywordsR = r'(?:' + redDefault + '|'.join(redirKeywords) + ')' except KeyError: # no localized keyword for redirects - redirKeywordsR = r'(?:%s|%s)' % (red, redDefault) + if redDefault == red: + redirKeywordsR = r'%s' % red + else: + redirKeywordsR = r'(?:%s|%s)' % (red, redDefault) # A redirect starts with hash (#), followed by a keyword, then # arbitrary stuff, then a wikilink. The wikilink may contain # a label, although this is not useful.
pywikipedia-l@lists.wikimedia.org