jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/639957 )
Change subject: [IMPR] reduce code complexity of pagegenerators.py ......................................................................
[IMPR] reduce code complexity of pagegenerators.py
Change-Id: Iead4cf7d1e1f6898d938c24538a8ad4697109c13 --- M pywikibot/pagegenerators.py 1 file changed, 5 insertions(+), 11 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py index f84dd27..74b61f3 100644 --- a/pywikibot/pagegenerators.py +++ b/pywikibot/pagegenerators.py @@ -2603,18 +2603,12 @@ dbname=site.dbName(), encoding=site.encoding(), verbose=verbose) + for row in row_gen: - namespaceNumber, pageName = row - if pageName: - # Namespace Dict only supports int - namespace = site.namespace(int(namespaceNumber)) - pageName = pageName.decode(site.encoding()) - if namespace: - pageTitle = '%s:%s' % (namespace, pageName) - else: - pageTitle = pageName - page = pywikibot.Page(site, pageTitle) - yield page + namespace_number, page_name = row + page_name = page_name.decode(site.encoding()) + page = pywikibot.Page(site, page_name, ns=int(namespace_number)) + yield page
class XMLDumpOldPageGenerator(Iterator):
pywikibot-commits@lists.wikimedia.org