jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/566521 )

Change subject: [IMPR] Increase skip counter and other improvements
......................................................................

[IMPR] Increase skip counter and other improvements

- increase _skip_counter if page is skipped by SkipPageError exception
- shorten info dict assignments
- shorten initialized_page assignment

Change-Id: I967fe7033a2ad0ee571795adc4984a70d1bc87fc
---
M pywikibot/bot.py
1 file changed, 5 insertions(+), 11 deletions(-)

Approvals:
  Mpaa: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/pywikibot/bot.py b/pywikibot/bot.py
index d0935a8..afafcc5 100644
--- a/pywikibot/bot.py
+++ b/pywikibot/bot.py
@@ -420,13 +420,9 @@
     log('PACKAGES:')
     for name in sorted(packages.keys()):
         info = packages[name]
-        if 'path' not in info:
-            if 'type' in info:
-                info['path'] = '[' + info['type'] + ']'
-            else:
-                info['path'] = '[path unknown]'
-        if 'ver' not in info:
-            info['ver'] = '??'
+        info.setdefault('path',
+                        '[{}]'.format(info.get('type', 'path unknown')))
+        info.setdefault('ver', '??')
         if 'err' in info:
             log('  %(name)s: %(err)s' % info)
         else:
@@ -1514,12 +1510,10 @@
                         # Python 2 does not clear the exception and it may seem
                         # that the generator stopped due to an exception
                         sys.exc_clear()
+                    self._skip_counter += 1
                     continue
                 else:
-                    if initialized_page is None:
-                        page = item
-                    else:
-                        page = initialized_page
+                    page = initialized_page or item

                 assert isinstance(page, pywikibot.page.BasePage), (
                     '"page" is not a pywikibot.page.BasePage object but {}.'

-- 
To view, visit https://gerrit.wikimedia.org/r/566521
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I967fe7033a2ad0ee571795adc4984a70d1bc87fc
Gerrit-Change-Number: 566521
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Dvorapa <[email protected]>
Gerrit-Reviewer: Mpaa <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot (75)
_______________________________________________
Pywikibot-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits

Reply via email to