Revision: 4041
Author: btongminh
Date: 2007-08-14 19:01:54 +0000 (Tue, 14 Aug 2007)
Log Message:
-----------
Making it actually work.
Modified Paths:
--------------
trunk/pywikipedia/delinker.txt
trunk/pywikipedia/image_replacer.py
Modified: trunk/pywikipedia/delinker.txt
===================================================================
--- trunk/pywikipedia/delinker.txt 2007-08-13 21:41:28 UTC (rev 4040)
+++ trunk/pywikipedia/delinker.txt 2007-08-14 19:01:54 UTC (rev 4041)
@@ -145,7 +145,8 @@
timestamp VARBINARY(14),
old_image VARBINARY(255),
new_image VARBINARY(255),
- status ENUM('pending', 'ok', 'refused', 'done'),
+ status ENUM('pending', 'ok', 'refused',
+ 'done', 'reported'),
user VARBINARY(255),
comment VARBINARY(255),
Modified: trunk/pywikipedia/image_replacer.py
===================================================================
--- trunk/pywikipedia/image_replacer.py 2007-08-13 21:41:28 UTC (rev 4040)
+++ trunk/pywikipedia/image_replacer.py 2007-08-14 19:01:54 UTC (rev 4041)
@@ -53,6 +53,7 @@
if self.config.get('replacer_report_replacements', False):
self.reporters = threadpool.ThreadPool(Reporter)
self.reporters.add_thread(self.site, self.config)
+ self.reporters.start()
def read_replace_log(self):
@@ -176,16 +177,16 @@
site.namespace(namespace), page_title)
not_ok_items.append(title)
- page = wikipedia.Page(self.site, u'Image:' + old_image)
- text = page.get()
- template = u'{{%s|new_image=%s|user=%s|comment=%s|not_ok=%}}' % \
+ template = u'{{%s|new_image=%s|user=%s|comment=%s|not_ok=%s}}' % \
(self.config['replacer_report_template'],
new_image, user, comment,
self.config.get('replacer_report_seperator', u', ').join(not_ok))
+ page = wikipedia.Page(self.site, u'Image:' + old_image)
+ text = page.get()
page.put(u'%s\n%s' % (template, text),
comment = u'This image has been replaced by ' + new_image)
- output(u'Reporting replacement of %s by %s to %s' % \
+ output(u'Reporting replacement of %s by %s.' % \
(old_image, new_image))