[Pywikipedia-l] SVN: [6239] trunk/pywikipedia/category.py
multichill at svn.wikimedia.org
multichill at svn.wikimedia.org
Fri Jan 9 19:35:01 UTC 2009
Revision: 6239
Author: multichill
Date: 2009-01-09 19:35:00 +0000 (Fri, 09 Jan 2009)
Log Message:
-----------
Removed setAction from add_category, CategoryListifyRobot & CategoryTidyRobot
Modified Paths:
--------------
trunk/pywikipedia/category.py
Modified: trunk/pywikipedia/category.py
===================================================================
--- trunk/pywikipedia/category.py 2009-01-09 19:23:18 UTC (rev 6238)
+++ trunk/pywikipedia/category.py 2009-01-09 19:35:00 UTC (rev 6239)
@@ -327,7 +327,7 @@
newcatTitle = newcatTitle[:1].capitalize() + newcatTitle[1:]
# set edit summary message
- wikipedia.setAction(wikipedia.translate(site, msg_add) % newcatTitle)
+ editSummary = wikipedia.translate(site, msg_add) % newcatTitle
cat_namespace = site.category_namespaces()[0]
@@ -382,7 +382,7 @@
text = page.get()
text = wikipedia.replaceCategoryLinks(text, cats)
try:
- page.put(text)
+ page.put(text, comment = editSummary)
except wikipedia.EditConflict:
wikipedia.output(
u'Skipping %s because of edit conflict'
@@ -641,6 +641,7 @@
def __init__(self, catTitle, catDB):
self.catTitle = catTitle
self.catDB = catDB
+ self.editSummary = wikipedia.translate(wikipedia.getSite(), msg_change) % cat.title()
def move_to_category(self, article, original_cat, current_cat):
'''
@@ -707,7 +708,7 @@
if current_cat == original_cat:
print 'No changes necessary.'
else:
- catlib.change_category(article, original_cat, current_cat)
+ catlib.change_category(article, original_cat, current_cat, comment = self.editSummary)
flag = True
elif choice in ['j', 'J']:
newCatTitle = wikipedia.input(u'Please enter the category the article should be moved to:')
@@ -717,7 +718,7 @@
flag = True
elif choice in ['r', 'R']:
# remove the category tag
- catlib.change_category(article, original_cat, None)
+ catlib.change_category(article, original_cat, None, comment = self.editSummary)
flag = True
elif choice == '?':
contextLength += 500
@@ -753,9 +754,6 @@
def run(self):
cat = catlib.Category(wikipedia.getSite(), 'Category:' + self.catTitle)
- # get edit summary message
- wikipedia.setAction(wikipedia.translate(wikipedia.getSite(), msg_change) % cat.title())
-
articles = cat.articlesList(recurse = False)
if len(articles) == 0:
wikipedia.output(u'There are no articles in category ' + catTitle)
More information about the Pywikipedia-l
mailing list