From 2169c376febee724a1ca6e44ffb9129df6ea17c8 Mon Sep 17 00:00:00 2001 From: Jude Nelson Date: Wed, 29 Mar 2017 01:03:25 -0400 Subject: [PATCH] don't prompt for email address in non-interactive mode --- blockstack_client/config.py | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/blockstack_client/config.py b/blockstack_client/config.py index b595c1a10..d9c354194 100644 --- a/blockstack_client/config.py +++ b/blockstack_client/config.py @@ -476,22 +476,26 @@ def configure(config_file=CONFIG_PATH, force=False, interactive=True, set_migrat # ask for contact info, so we can send out notifications for bugfixes and # upgrades if blockstack_opts.get('email') is None: - email_msg = ( - 'Would you like to receive notifications\n' - 'from the developers when there are critical\n' - 'updates available to install?\n\n' - 'If so, please enter your email address here.\n' - 'If not, leave this field blank.\n\n' - 'Your email address will be used solely\n' - 'for this purpose.\n' - ) - email_opts, _, email_prompted = find_missing( - email_msg, ['email'], {}, {'email': ''}, prompt_missing=interactive - ) + if interactive: + email_msg = ( + 'Would you like to receive notifications\n' + 'from the developers when there are critical\n' + 'updates available to install?\n\n' + 'If so, please enter your email address here.\n' + 'If not, leave this field blank.\n\n' + 'Your email address will be used solely\n' + 'for this purpose.\n' + ) + email_opts, _, email_prompted = find_missing( + email_msg, ['email'], {}, {'email': ''}, prompt_missing=interactive + ) - # merge with blockstack section - num_blockstack_opts_prompted += 1 - blockstack_opts['email'] = email_opts['email'] + # merge with blockstack section + num_blockstack_opts_prompted += 1 + blockstack_opts['email'] = email_opts['email'] + + else: + blockstack_opts['email'] = '' # get client UUID for analytics u = get_or_set_uuid(config_dir=config_dir)