Is this a good idea? It fixes the reported bug of
[[CateGORY:Foo]], but it
possibly introduces a new bug of confusing [[Category:Foo bar]] with
[[Category:Foo Bar]]. One might say that it is a "bad thing" to have two
categories named that way, but we cannot assure that it will never happen.
-----Original Message-----
From: pywikipedia-l-bounces(a)lists.wikimedia.org
[mailto:pywikipedia-l-bounces@lists.wikimedia.org] On Behalf
Of nicdumz(a)svn.wikimedia.org
Sent: Sunday, May 18, 2008 6:53 AM
To: pywikipedia-l(a)lists.wikimedia.org
Subject: [Pywikipedia-l] SVN: [5395] trunk/pywikipedia/wikipedia.py
Revision: 5395
Author: nicdumz
Date: 2008-05-18 10:53:07 +0000 (Sun, 18 May 2008)
Log Message:
-----------
making replaceCategoryInPlace and removeCategoryLinks
category regexes case insensitive
Modified Paths:
--------------
trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py 2008-05-18 10:42:14 UTC
(rev 5394)
+++ trunk/pywikipedia/wikipedia.py 2008-05-18 10:53:07 UTC
(rev 5395)
@@ -3388,7 +3388,7 @@
# NOTE: This assumes that language codes only consist of
non-capital
# ASCII letters and hyphens.
catNamespace = '|'.join(site.category_namespaces())
- categoryR = re.compile(r'\[\[\s*(%s)\s*:.*?\]\][\s]*' %
catNamespace)
+ categoryR = re.compile(r'\[\[\s*(%s)\s*:.*?\]\][\s]*' %
+ catNamespace, re.I)
text = replaceExcept(text, categoryR, '', ['nowiki',
'comment', 'math', 'pre', 'source'], marker = marker)
return text.strip()
@@ -3412,7 +3412,7 @@
# spaces and underscores in page titles are
interchangeable, and collapsible
title = title.replace(r"\ ", "[ _]+").replace(r"\_",
"[ _]+")
categoryR =
re.compile(r'\[\[\s*(%s)\s*:\s*%s\s*((?:\|[^]]+)?\]\])'
- % (catNamespace, title))
+ % (catNamespace, title), re.I)
if newcat is None:
text = replaceExcept(oldtext, categoryR, '',
['nowiki', 'comment', 'math',
'pre', 'source'])
_______________________________________________
Pywikipedia-l mailing list
Pywikipedia-l(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
No virus found in this incoming message.
Checked by AVG.
Version: 8.0.100 / Virus Database: 269.23.20/1453 - Release
Date: 5/18/2008 9:31 AM
_______________________________________________
Pywikipedia-l mailing list
Pywikipedia-l(a)lists.wikimedia.org