Browse Source

globalvars.py: required_opts -> init_opts

The MMGen Project 3 years ago
parent
commit
91156f6847
4 changed files with 6 additions and 11 deletions
  1. 2 7
      mmgen/globalvars.py
  2. 1 1
      mmgen/opts.py
  3. 1 1
      test/misc/opts.py
  4. 2 2
      test/test_py_d/ts_opts.py

+ 2 - 7
mmgen/globalvars.py

@@ -168,13 +168,8 @@ class GlobalContext(Lockable):
 		'daemon_data_dir','force_256_color','regtest','coin','bob','alice',
 		'daemon_data_dir','force_256_color','regtest','coin','bob','alice',
 		'accept_defaults','token','ignore_daemon_version','daemon_id','http_timeout',
 		'accept_defaults','token','ignore_daemon_version','daemon_id','http_timeout',
 	)
 	)
-	# opts initialized to None by opts.init() if not set by user
-	required_opts = (
-		'quiet','verbose','debug','outdir','echo_passphrase','passwd_file','stdout',
-		'show_hash_presets','label','keep_passphrase','keep_hash_preset','yes',
-		'brain_params','b16','usr_randchars','coin','bob','alice',
-		'hidden_incog_input_params','in_fmt','hash_preset','seed_len',
-	)
+	# opts not in common_opts but required to be set during opts initialization
+	init_opts = ('show_hash_presets','yes','verbose')
 	incompatible_opts = (
 	incompatible_opts = (
 		('help','longhelp'),
 		('help','longhelp'),
 		('bob','alice'),
 		('bob','alice'),

+ 1 - 1
mmgen/opts.py

@@ -253,7 +253,7 @@ def init(opts_data=None,add_opts=None,init_opts=None,opt_filter=None,parse_only=
 			+ po.skipped_opts
 			+ po.skipped_opts
 			+ tuple(add_opts or [])
 			+ tuple(add_opts or [])
 			+ tuple(init_opts or [])
 			+ tuple(init_opts or [])
-			+ g.required_opts
+			+ g.init_opts
 			+ g.common_opts ):
 			+ g.common_opts ):
 		setattr(opt,o,po.user_opts[o] if o in po.user_opts else None)
 		setattr(opt,o,po.user_opts[o] if o in po.user_opts else None)
 
 

+ 1 - 1
test/misc/opts.py

@@ -53,7 +53,7 @@ if cmd_args == ['show_common_opts_diff']:
 for k in (
 for k in (
 	'foo',               # added opt
 	'foo',               # added opt
 	'print_checksum',    # sets 'quiet'
 	'print_checksum',    # sets 'quiet'
-	'quiet','verbose',   # required_opts, incompatible_opts
+	'quiet','verbose',   # init_opts, incompatible_opts
 	'fee_estimate_mode', # autoset_opts
 	'fee_estimate_mode', # autoset_opts
 	'passwd_file',       # infile_opts - check_infile()
 	'passwd_file',       # infile_opts - check_infile()
 	'outdir',            # check_outdir()
 	'outdir',            # check_outdir()

+ 2 - 2
test/test_py_d/ts_opts.py

@@ -59,8 +59,8 @@ class TestSuiteOpts(TestSuiteBase):
 				(
 				(
 					('opt.foo',               'None'),         # added opt
 					('opt.foo',               'None'),         # added opt
 					('opt.print_checksum',    'None'),         # sets 'quiet'
 					('opt.print_checksum',    'None'),         # sets 'quiet'
-					('opt.quiet',             'False'),        # required_opts, incompatible_opts
-					('opt.verbose',           'None'),         # required_opts, incompatible_opts
+					('opt.quiet',             'False'),        # init_opts, incompatible_opts
+					('opt.verbose',           'None'),         # init_opts, incompatible_opts
 					('opt.fee_estimate_mode', 'conservative'), # autoset_opts
 					('opt.fee_estimate_mode', 'conservative'), # autoset_opts
 					('opt.passwd_file',       'None'),         # infile_opts - check_infile()
 					('opt.passwd_file',       'None'),         # infile_opts - check_infile()
 					('opt.outdir',            'None'),         # check_outdir()
 					('opt.outdir',            'None'),         # check_outdir()