jenkins-bot merged this change.

View Change

Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
[cleanup] cleanup scripts/login.py

- use single quotes for string literals and double quotes
**only** if they consist of single quotes within them
- use str.format(...) instead of modulo for type specifier
arguments

Change-Id: I6c37e385ca9feefa4c22876d8b65203329920894
---
M scripts/login.py
1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/scripts/login.py b/scripts/login.py
index 04f20ad..969ddff 100755
--- a/scripts/login.py
+++ b/scripts/login.py
@@ -126,21 +126,22 @@
autocreate = False
unknown_args = []
for arg in pywikibot.handle_args(args):
- if arg.startswith("-pass"):
+ if arg.startswith('-pass'):
if len(arg) == 5:
password = pywikibot.input(
'Password for all accounts (no characters will be shown):',
password=True)
else:
password = arg[6:]
- elif arg == "-sysop":
+ elif arg == '-sysop':
sysop = True
- elif arg == "-all":
+ elif arg == '-all':
logall = True
- elif arg == "-force":
- pywikibot.output(u"To force a re-login, please delete the revelant "
- u"lines from '%s' (or the entire file) and try again." %
- join(config.base_dir, 'pywikibot.lwp'))
+ elif arg == '-force':
+ pywikibot.output('To force a re-login, please delete the '
+ "revelant lines from '{0}' (or the entire file) "
+ 'and try again.'
+ .format(join(config.base_dir, 'pywikibot.lwp')))
elif arg == "-logout":
logout = True
elif arg == '-oauth':
@@ -188,9 +189,10 @@
pywikibot.output(
'Not logged in on {0}.'.format(site))
except SiteDefinitionError:
- pywikibot.output(u'%s.%s is not a valid site, please remove it'
- ' from your config' % (lang, family_name))
+ pywikibot.output('{0}.{1} is not a valid site, '
+ 'please remove it from your config'
+ .format(lang, family_name))


-if __name__ == "__main__":
+if __name__ == '__main__':
main()

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

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I6c37e385ca9feefa4c22876d8b65203329920894
Gerrit-Change-Number: 462504
Gerrit-PatchSet: 2
Gerrit-Owner: D3r1ck01 <alangiderick@gmail.com>
Gerrit-Reviewer: D3r1ck01 <alangiderick@gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb@gmail.com>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot (75)