Revision: 4277 Author: wikipedian Date: 2007-09-13 18:50:34 +0000 (Thu, 13 Sep 2007)
Log Message: ----------- applied patch redirect_py.patch by Aurimas Fischer - ebola_rulez [ 1773928 ] bug in redirect.py -xml
Modified Paths: -------------- trunk/pywikipedia/redirect.py
Modified: trunk/pywikipedia/redirect.py =================================================================== --- trunk/pywikipedia/redirect.py 2007-09-13 18:23:06 UTC (rev 4276) +++ trunk/pywikipedia/redirect.py 2007-09-13 18:50:34 UTC (rev 4277) @@ -124,18 +124,20 @@ break # if the redirect does not link to another wiki if target: + source = entry.title.replace(' ', '_') target = target.replace(' ', '_') # remove leading and trailing whitespace target = target.strip() # capitalize the first letter if not wikipedia.getSite().nocapitalize: + source = source[0].upper() + source[1:] target = target[0].upper() + target[1:] if '#' in target: target = target[:target.index('#')] if '|' in target: wikipedia.output(u'HINT: %s is a redirect with a pipelink.' % entry.title) target = target[:target.index('|')] - dict[entry.title] = target + dict[source] = target if alsoGetPageTitles: return dict, pageTitles else: