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
pywikipedia-svn@lists.wikimedia.org