http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9800
Revision: 9800
Author: xqt
Date: 2011-12-12 06:35:44 +0000 (Mon, 12 Dec 2011)
Log Message:
-----------
don't change file namespaces at pt-wiki due to bug #3346901 (new feature should be implemented)
Modified Paths:
--------------
trunk/pywikipedia/cosmetic_changes.py
Modified: trunk/pywikipedia/cosmetic_changes.py
===================================================================
--- trunk/pywikipedia/cosmetic_changes.py 2011-12-12 06:19:10 UTC (rev 9799)
+++ trunk/pywikipedia/cosmetic_changes.py 2011-12-12 06:35:44 UTC (rev 9800)
@@ -324,12 +324,15 @@
continue
namespaces = list(self.site.namespace(nsNumber, all = True))
thisNs = namespaces.pop(0)
- if nsNumber == 6 and family.name == 'wikipedia' and \
- self.site.lang in ('en', 'fr'):
- # do not change "Image" on en-wiki and fr-wiki
- for image in [u'Image', u'image']:
- if image in namespaces:
- namespaces.remove(image)
+ if nsNumber == 6 and family.name == 'wikipedia'
+ if self.site.lang in ('en', 'fr'):
+ # do not change "Image" on en-wiki and fr-wiki
+ for image in [u'Image', u'image']:
+ if image in namespaces:
+ namespaces.remove(image)
+ elif self.site.lang == 'pt':
+ # bug #3346901 should be implemented
+ continue
# skip main (article) namespace
if thisNs and namespaces:
text = pywikibot.replaceExcept(
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9799
Revision: 9799
Author: xqt
Date: 2011-12-12 06:19:10 +0000 (Mon, 12 Dec 2011)
Log Message:
-----------
docstring typo
Modified Paths:
--------------
trunk/pywikipedia/pywikibot/textlib.py
Modified: trunk/pywikipedia/pywikibot/textlib.py
===================================================================
--- trunk/pywikipedia/pywikibot/textlib.py 2011-12-12 06:18:30 UTC (rev 9798)
+++ trunk/pywikipedia/pywikibot/textlib.py 2011-12-12 06:19:10 UTC (rev 9799)
@@ -41,7 +41,7 @@
Parameters:
text - a unicode string
- old - a compiled od uncompiled regular expression
+ old - a compiled or uncompiled regular expression
new - a unicode string (which can contain regular
expression references), or a function which takes
a match object as parameter. See parameter repl of
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9798
Revision: 9798
Author: xqt
Date: 2011-12-12 06:18:30 +0000 (Mon, 12 Dec 2011)
Log Message:
-----------
Textlib.py?\226?\128?\153s compileLinkR should exlude ")" at the end of URLs. patch bug #3455789 submitted by loxley. Update from trunk r9797.
Modified Paths:
--------------
branches/rewrite/pywikibot/textlib.py
Modified: branches/rewrite/pywikibot/textlib.py
===================================================================
--- branches/rewrite/pywikibot/textlib.py 2011-12-12 06:12:10 UTC (rev 9797)
+++ branches/rewrite/pywikibot/textlib.py 2011-12-12 06:18:30 UTC (rev 9798)
@@ -701,7 +701,7 @@
# Note: While allowing dots inside URLs, MediaWiki will regard
# dots at the end of the URL as not part of that URL.
# The same applies to comma, colon and some other characters.
- notAtEnd = '\]\s\.:;,<>"\|'
+ notAtEnd = '\]\s\.:;,<>"\|\)'
# So characters inside the URL can be anything except whitespace,
# closing squared brackets, quotation marks, greater than and less
# than, and the last character also can't be parenthesis or another
@@ -834,5 +834,3 @@
# Add it to the result
result.append((name, params))
return result
-
-
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9797
Revision: 9797
Author: xqt
Date: 2011-12-12 06:12:10 +0000 (Mon, 12 Dec 2011)
Log Message:
-----------
Textlib.py?\226?\128?\153s compileLinkR should exlude ")" at the end of URLs. patch bug #3455789 submitted by loxley. Thanks.
Modified Paths:
--------------
trunk/pywikipedia/pywikibot/textlib.py
Modified: trunk/pywikipedia/pywikibot/textlib.py
===================================================================
--- trunk/pywikipedia/pywikibot/textlib.py 2011-12-11 13:47:50 UTC (rev 9796)
+++ trunk/pywikipedia/pywikibot/textlib.py 2011-12-12 06:12:10 UTC (rev 9797)
@@ -747,7 +747,7 @@
# Note: While allowing dots inside URLs, MediaWiki will regard
# dots at the end of the URL as not part of that URL.
# The same applies to comma, colon and some other characters.
- notAtEnd = '\]\s\.:;,<>"\|'
+ notAtEnd = '\]\s\.:;,<>"\|\)'
# So characters inside the URL can be anything except whitespace,
# closing squared brackets, quotation marks, greater than and less
# than, and the last character also can't be parenthesis or another
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9793
Revision: 9793
Author: xqt
Date: 2011-12-09 18:25:00 +0000 (Fri, 09 Dec 2011)
Log Message:
-----------
Some iw links are encoded with html entity. Decode &-entity first. See http://de.wikipedia.org/w/index.php?title=Benutzer_Diskussion%3AXqt&action=…
Modified Paths:
--------------
trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py 2011-12-09 14:31:19 UTC (rev 9792)
+++ trunk/pywikipedia/wikipedia.py 2011-12-09 18:25:00 UTC (rev 9793)
@@ -4643,7 +4643,7 @@
# This regular expression will match any decimal and hexadecimal entity and
# also entities that might be named entities.
entityR = re.compile(
- r'&(#(?P<decimal>\d+)|#x(?P<hex>[0-9a-fA-F]+)|(?P<name>[A-Za-z]+));')
+ r'&(?:amp;)?(#(?P<decimal>\d+)|#x(?P<hex>[0-9a-fA-F]+)|(?P<name>[A-Za-z]+));')
# These characters are Html-illegal, but sadly you *can* find some of
# these and converting them to unichr(decimal) is unsuitable
convertIllegalHtmlEntities = {