jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/423200 )
Change subject: generate_user_config.py: Check a previous user-password.py ......................................................................
generate_user_config.py: Check a previous user-password.py
If file exists, it'll simply print a warning (using file_exists() fct) and bypass the filling of botpasswords.
Bug: T167573 Change-Id: I71606c0075e49ac1a7161c9bcbeace3ae2d3dc45 --- M generate_user_files.py 1 file changed, 3 insertions(+), 4 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/generate_user_files.py b/generate_user_files.py index 67f79af..5c62f78 100755 --- a/generate_user_files.py +++ b/generate_user_files.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- """Script to create user-config.py.""" # -# (C) Pywikibot team, 2010-2017 +# (C) Pywikibot team, 2010-2018 # # Distributed under the terms of the MIT license. # @@ -238,8 +238,7 @@ """ _fnc = os.path.join(base_dir, "user-config.py") _fncpass = os.path.join(base_dir, 'user-password.py') - # TODO: T167573: better check for existing user-password file - if file_exists(_fnc) or file_exists(_fncpass): + if file_exists(_fnc): return
if args and force and not config.verbose_output: @@ -261,7 +260,7 @@ if not main_username: usernames = "# usernames['{0}']['{1}'] = u'MyUsername'".format( main_family, main_code) - else: + elif not file_exists(_fncpass): # For each different username entered, ask if user wants to save a # BotPassword (username, BotPassword name, BotPassword pass) seen = set()
pywikibot-commits@lists.wikimedia.org