Revision: 8344 Author: xqt Date: 2010-07-05 17:49:14 +0000 (Mon, 05 Jul 2010)
Log Message: ----------- reflinks.py: minor fixes for r8339 (patch request bug #3022004) noreferences.py: added re.UNICODE for realy ignore case
Modified Paths: -------------- trunk/pywikipedia/noreferences.py trunk/pywikipedia/reflinks.py
Modified: trunk/pywikipedia/noreferences.py =================================================================== --- trunk/pywikipedia/noreferences.py 2010-07-05 17:32:45 UTC (rev 8343) +++ trunk/pywikipedia/noreferences.py 2010-07-05 17:49:14 UTC (rev 8344) @@ -205,7 +205,7 @@ ], 'ru': [ u'Примечания', - u'Ссылки', + u'Сноски', u'Источники', ], 'eo': [ @@ -303,7 +303,6 @@ u'Ref-list',u'Reference list',u'References-small',u'Reflink', u'Footnotes',u'FootnotesSmall'], 'ru': [u'Reflist',u'Ref-list',u'Refs',u'Sources', - u'примечания',u'список примечаний', u'Примечания',u'Список примечаний', u'Сноска',u'Сноски'], 'eo': [u'Referencoj'], @@ -392,7 +391,7 @@ return False elif self.referencesTemplates: templateR = u'{{(' + u'|'.join(self.referencesTemplates) + ')' - if re.search(templateR, oldTextCleaned, re.IGNORECASE): + if re.search(templateR, oldTextCleaned, re.IGNORECASE|re.UNICODE): if verbose: wikipedia.output(u'No changes necessary: references template found.') return False
Modified: trunk/pywikipedia/reflinks.py =================================================================== --- trunk/pywikipedia/reflinks.py 2010-07-05 17:32:45 UTC (rev 8343) +++ trunk/pywikipedia/reflinks.py 2010-07-05 17:49:14 UTC (rev 8344) @@ -580,8 +580,10 @@
meta_content = self.META_CONTENT.search(linkedpagetext) enc = [] - # use charset from http header - s = self.CHARSET.search(contentType) + s = None + if contentType: + # use charset from http header + s = self.CHARSET.search(contentType) if meta_content: tag = meta_content.group() # Prefer the contentType from the HTTP header :
pywikipedia-svn@lists.wikimedia.org