http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9413
Revision: 9413
Author: xqt
Date: 2011-07-17 12:29:50 +0000 (Sun, 17 Jul 2011)
Log Message:
-----------
do not add separator line in special cases (bugfix for bug #3281226)
Modified Paths:
--------------
trunk/pywikipedia/pywikibot/textlib.py
Modified: trunk/pywikipedia/pywikibot/textlib.py
===================================================================
--- trunk/pywikipedia/pywikibot/textlib.py 2011-07-17 10:56:14 UTC (rev 9412)
+++ trunk/pywikipedia/pywikibot/textlib.py 2011-07-17 12:29:50 UTC (rev 9413)
@@ -408,7 +408,11 @@
if s:
if site.language() in site.family.interwiki_attop or \
u'<!-- interwiki at top -->' in oldtext:
- newtext = s + separator + s2.replace(marker,'').strip()
+ #do not add separator if interiki links are on one line
+ newtext = s + \
+ [separator, u''][site.language() in
+ site.family.interwiki_on_one_line] + \
+ s2.replace(marker, '').strip()
else:
# calculate what was after the language links on the page
firstafter = s2.find(marker)
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9411
Revision: 9411
Author: xqt
Date: 2011-07-17 10:19:06 +0000 (Sun, 17 Jul 2011)
Log Message:
-----------
(user_)fixes.py stores recursive flag, patch bug #3368258 submitted by Bin?\195?\161ris. Thanks!
Modified Paths:
--------------
trunk/pywikipedia/replace.py
Modified: trunk/pywikipedia/replace.py
===================================================================
--- trunk/pywikipedia/replace.py 2011-07-17 09:54:30 UTC (rev 9410)
+++ trunk/pywikipedia/replace.py 2011-07-17 10:19:06 UTC (rev 9411)
@@ -80,8 +80,8 @@
-fix:XYZ Perform one of the predefined replacements tasks, which are
given in the dictionary 'fixes' defined inside the file
fixes.py.
- The -regex and -nocase argument and given replacements will
- be ignored if you use -fix.
+ The -regex, -recursive and -nocase argument and given
+ replacements and exceptions will be ignored if you use -fix.
Currently available predefined fixes are:
&fixes-help;
@@ -717,9 +717,15 @@
fix['msg'])
if "exceptions" in fix:
exceptions = fix['exceptions']
+ if "recursive" in fix:
+ recursive = fix['recursive']
if "nocase" in fix:
caseInsensitive = fix['nocase']
- replacements = fix['replacements']
+ try:
+ replacements = fix['replacements']
+ except KeyError:
+ pywikibot.output(u"No replacements given in fix, don't joke with me!")
+ return
#Set the regular expression flags
flags = re.UNICODE
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9409
Revision: 9409
Author: multichill
Date: 2011-07-16 23:05:34 +0000 (Sat, 16 Jul 2011)
Log Message:
-----------
Also skip hidden categories.
Modified Paths:
--------------
trunk/pywikipedia/imageuncat.py
Modified: trunk/pywikipedia/imageuncat.py
===================================================================
--- trunk/pywikipedia/imageuncat.py 2011-07-16 22:04:42 UTC (rev 9408)
+++ trunk/pywikipedia/imageuncat.py 2011-07-16 23:05:34 UTC (rev 9409)
@@ -1296,11 +1296,12 @@
for category in page.categories():
# Check if it's not a red link category
if category.exists():
- # Check if it's not a category to ignore
- if category.title() not in ignoreCategories:
- pywikibot.output(u'Got category ' + category.title())
- return False
- #FIXME: Add check if the category is hidden. If hidden -> ignore
+ # If the category is hidden -> ignore it, it's not a topic category
+ if not category.isHiddenCategory():
+ # Check if it's not a category to ignore
+ if category.title() not in ignoreCategories:
+ pywikibot.output(u'Got category ' + category.title())
+ return False
for templateWithTrail in page.templates():
#Strip of trailing garbage