http://www.mediawiki.org/wiki/Special:Code/pywikipedia/8951
Revision: 8951
Author: russblau
Date: 2011-02-14 14:44:06 +0000 (Mon, 14 Feb 2011)
Log Message:
-----------
Avoid recursive categorization (a category description page should not be a member of its own category).
Modified Paths:
--------------
branches/rewrite/scripts/category_redirect.py
Modified: branches/rewrite/scripts/category_redirect.py
===================================================================
--- branches/rewrite/scripts/category_redirect.py 2011-02-14 02:08:30 UTC (rev 8950)
+++ branches/rewrite/scripts/category_redirect.py 2011-02-14 14:44:06 UTC (rev 8951)
@@ -218,7 +218,7 @@
"""
oldtext = article.get(get_redirect=True, force=True)
- if newCat in article.categories():
+ if newCat in article.categories() or newcat == article:
newtext = pywikibot.replaceCategoryInPlace(oldtext, oldCat, None,
site=self.site)
else:
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/8947
Revision: 8947
Author: amir
Date: 2011-02-10 00:14:09 +0000 (Thu, 10 Feb 2011)
Log Message:
-----------
fixup for r8679
Modified Paths:
--------------
trunk/pywikipedia/catlib.py
Modified: trunk/pywikipedia/catlib.py
===================================================================
--- trunk/pywikipedia/catlib.py 2011-02-09 22:13:09 UTC (rev 8946)
+++ trunk/pywikipedia/catlib.py 2011-02-10 00:14:09 UTC (rev 8947)
@@ -458,11 +458,17 @@
wikipedia.output('Moving text from %s to %s.' % (self.title(), targetCat.title()))
authors = ', '.join(self.contributingUsers())
creationSummary = wikipedia.translate(wikipedia.getSite(), msg_created_for_renaming) % (self.title(), authors)
- #Maybe sometimes length of summary is more than 200 characters and thus will not be shown.so bot must listify authors in another place
+ #Maybe sometimes length of summary is more than 200 characters and thus will not be shown.
+ #For avoidning copyright violation bot must listify authors in another place
if len(creationSummary)>200:
- targetCat.put(self.get()+u"/n/nAuthors: %s" % authors, creationSummary)
- else:
- targetCat.put(self.get(), creationSummary)
+ talkpage=targetCat.toggleTalkPage()
+ try:
+ talktext=talkpage.get()
+ except:
+ talkpage.put(u"==Authors==\n%s-~~~~" % authors, u"Bot:Listifying authors")
+ else:
+ talkpage.put(talktext+u"\n==Authors==\n%s-~~~~" % authors, u"Bot:Listifying authors")
+ targetCat.put(self.get(), creationSummary)
return True
#Like copyTo above, except this removes a list of templates (like deletion templates) that appear in