cmd_line_args = OrderedDict() for arg in sys.argv[1:]: arg_parts = arg.split("=", 1) option_name = arg_parts[0] assert option_name.startswith('--') if len(arg_parts) == 1: cmd_line_args[option_name[2:]] = 'true' else: cmd_line_args[option_name[2:]] = arg_parts[1] options = process_command_line_options(cmd_line_args) if options is not None: if options['noui']: rando = Randomizer(options) if not options['dry-run']: rando.check_valid_directory_setup() total_progress_steps = rando.get_total_progress_steps() progress_steps = 0 def progress_callback(action): global progress_steps print(f'{action} {progress_steps}/{total_progress_steps}') progress_steps += 1 rando.progress_callback = progress_callback rando.randomize() print(rando.seed) else: from randogui import run_main_gui run_main_gui()
def randothread(start, end, local_opts): for i in range(start, end): local_opts.set_option('seed', i) rando = Randomizer(local_opts) rando.randomize()