jenkins-bot merged this change.
[IMPR] Count skipped pages
Count pages skipped by skip_page method.
Change-Id: I60948ad71a8155ddd7814133c2c9ea0ec8bacc62
---
M pywikibot/bot.py
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/pywikibot/bot.py b/pywikibot/bot.py
index 27efb43..954d07f 100644
--- a/pywikibot/bot.py
+++ b/pywikibot/bot.py
@@ -1209,6 +1209,7 @@
self._treat_counter = 0
self._save_counter = 0
+ self._skip_counter = 0
self._generator_completed = False
@property
@@ -1380,9 +1381,12 @@
May be overridden by subclasses.
"""
self.teardown()
- pywikibot.output('\n%i pages read'
- '\n%i pages written'
- % (self._treat_counter, self._save_counter))
+ pywikibot.output('\n{} pages read'
+ '\n{} pages written'
+ '\n{} pages skipped'
+ .format(self._treat_counter,
+ self._save_counter,
+ self._skip_counter))
if hasattr(self, '_start_ts'):
delta = (pywikibot.Timestamp.now() - self._start_ts)
seconds = int(delta.total_seconds())
@@ -1500,6 +1504,7 @@
.format(page.__class__))
if self.skip_page(page):
+ self._skip_counter += 1
continue
# Process the page
To view, visit change 511306. To unsubscribe, or for help writing mail filters, visit settings.