jenkins-bot submitted this change.

View Change

Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
[cleanup] Consistently use string's format()

String formatting from PEP3101 is intended to replace printf style
formatting [1][2]. date.py, i18n.py, and a few scripts have especially
sophisticated usage so leaving those be.

This also drops unnecessary index references [3] and repr() [4] from format
calls.

[1] https://www.python.org/dev/peps/pep-3101/#abstract
[2] https://docs.python.org/3/library/stdtypes.html#printf-style-string-formatting

[3] The following are identical...

>>> '{0} {1}'.format('arg1', 'arg2')
>>> '{} {}'.format('arg1', 'arg2')

[4] The following are identical...

>>> 'repr value: {}.format(repr(my_arg))
>>> 'repr value: {!r}.format(my_arg)

Change-Id: I5191814201ca1f4dcfa3a6c587be0dd2b9fe76ff
---
M generate_user_files.py
M pwb.py
M pywikibot/__init__.py
M pywikibot/_wbtypes.py
M pywikibot/bot.py
M pywikibot/bot_choice.py
M pywikibot/comms/eventstreams.py
M pywikibot/comms/http.py
M pywikibot/config.py
M pywikibot/cosmetic_changes.py
M pywikibot/data/api.py
M pywikibot/data/mysql.py
M pywikibot/data/sparql.py
M pywikibot/date.py
M pywikibot/diff.py
M pywikibot/editor.py
M pywikibot/exceptions.py
M pywikibot/family.py
M pywikibot/i18n.py
M pywikibot/interwiki_graph.py
M pywikibot/logentries.py
M pywikibot/login.py
M pywikibot/page/__init__.py
M pywikibot/page/_decorators.py
M pywikibot/pagegenerators.py
M pywikibot/proofreadpage.py
M pywikibot/site/_apisite.py
M pywikibot/site/_basesite.py
M pywikibot/site/_datasite.py
M pywikibot/site/_decorators.py
M pywikibot/site/_extensions.py
M pywikibot/site/_generators.py
M pywikibot/site/_interwikimap.py
M pywikibot/site/_namespace.py
M pywikibot/site/_siteinfo.py
M pywikibot/site/_tokenwallet.py
M pywikibot/site_detect.py
M pywikibot/specialbots/_upload.py
M pywikibot/textlib.py
M pywikibot/tools/__init__.py
M pywikibot/tools/djvu.py
M pywikibot/tools/formatter.py
M pywikibot/userinterfaces/gui.py
M pywikibot/userinterfaces/terminal_interface_base.py
M pywikibot/userinterfaces/win32_unicode.py
M pywikibot/version.py
M scripts/archive/blockpageschecker.py
M scripts/archive/compat2core.py
M scripts/archive/flickrripper.py
M scripts/archive/followlive.py
M scripts/archive/freebasemappingupload.py
M scripts/archive/imagecopy_self.py
M scripts/archive/imageuncat.py
M scripts/archive/isbn.py
M scripts/archive/lonelypages.py
M scripts/archive/makecat.py
M scripts/archive/ndashredir.py
M scripts/archive/selflink.py
M scripts/archive/standardize_interwiki.py
M scripts/archive/states_redirect.py
M scripts/archive/surnames_redirects.py
M scripts/archive/table2wiki.py
M scripts/archivebot.py
M scripts/category.py
M scripts/category_redirect.py
M scripts/checkimages.py
M scripts/cosmetic_changes.py
M scripts/delete.py
M scripts/fixing_redirects.py
M scripts/image.py
M scripts/imagetransfer.py
M scripts/interwiki.py
M scripts/listpages.py
M scripts/login.py
M scripts/maintenance/cache.py
M scripts/maintenance/colors.py
M scripts/maintenance/make_i18n_dict.py
M scripts/maintenance/wikimedia_sites.py
M scripts/movepages.py
M scripts/newitem.py
M scripts/noreferences.py
M scripts/nowcommons.py
M scripts/pagefromfile.py
M scripts/patrol.py
M scripts/protect.py
M scripts/redirect.py
M scripts/replace.py
M scripts/replicate_wiki.py
M scripts/revertbot.py
M scripts/solve_disambiguation.py
M scripts/template.py
M scripts/touch.py
M scripts/transferbot.py
M scripts/unusedfiles.py
M scripts/version.py
M scripts/watchlist.py
M scripts/weblinkchecker.py
M scripts/welcome.py
M setup.py
M tests/__init__.py
M tests/api_tests.py
M tests/aspects.py
M tests/basesite_tests.py
M tests/date_tests.py
M tests/eventstreams_tests.py
M tests/file_tests.py
M tests/l10n_tests.py
M tests/link_tests.py
M tests/linter_tests.py
M tests/logentries_tests.py
M tests/page_tests.py
M tests/pagegenerators_tests.py
M tests/paraminfo_tests.py
M tests/patrolbot_tests.py
M tests/plural_tests.py
M tests/replacebot_tests.py
M tests/script_tests.py
M tests/site_tests.py
M tests/ui_tests.py
M tests/upload_tests.py
M tests/user_tests.py
M tests/wikibase_tests.py
M tox.ini
123 files changed, 1,215 insertions(+), 1,171 deletions(-)


To view, visit change 684061. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I5191814201ca1f4dcfa3a6c587be0dd2b9fe76ff
Gerrit-Change-Number: 684061
Gerrit-PatchSet: 6
Gerrit-Owner: Damian <atagar1@gmail.com>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki@aol.com>
Gerrit-Reviewer: Isaacandy <isaac@iznd.xyz>
Gerrit-Reviewer: Siebrand <siebrand@kitano.nl>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged