print( line_count, "Need {} have {} / {} -> {} at line {} {}".format( settings_needed, settings_got(line), my_from, my_to, line_count, "REPLACE" if 'cht' in line else "ADD")) if my_src not in file_open_after: file_open_after[my_src] = line_count continue if cht_count: print(cht_count, "total cht-is constructions to fix.") else: print("Woohoo! No cht-is bugs in the main source.") cmd_count = 1 while cmd_count < len(sys.argv): arg = nohy(sys.argv[cmd_count]) if arg == 'a': add_and_verify = True elif arg == 'd': debug = True elif arg == 'na' or arg == 'an': add_and_verify = False elif arg == 'e' or arg == 'ec' or arg == 'ce': i7.open_source_config() exit() elif arg == 'es' or arg == 'se': i7.open_source() exit() else: usage() cmd_count += 1
cur_sec + ("/" + subsection if subsection else ""), "is duplicated from", mist_done[x], "section", mist_sec[x]) mt.add_postopen_file_line(mi, line_count, rewrite=False) total_errs += 1 if cur_sec == 'TO-DO': errs_todo += 1 else: errs_table += 1 else: mist_done[x] = line_count mist_sec[x] = cur_sec + ("/" + subsection if subsection else "") cmd_count = 1 while cmd_count < len(sys.argv): arg = mt.nohy(sys.argv[cmd_count]) if arg[:2] == 's:': search_for_opening(r'\[start (of )?{}\b'.format(arg[2:])) search_for_opening(r'\[start (of )? {}\b'.format(arg[2:])) exit() cmd_count += 1 print("Gauged", mists, "total good guesses,", mist_table, "in table and", mist_todo, "in todo.") if not total_errs: print("Hooray! No mistakes in the, um, mistakes!") else: print("Duplicates:", errs_table, "in table and", errs_todo, "in todo.") mt.postopen_files()
else: print("No INSTEADS string for", q) default_project = "ailihphilia" my_project = i7.dir2proj(os.getcwd()) if not my_project: print("Project directory not located. Using default", default_project) my_project = default_project cmd_proj = "" cmd_count = 1 get_potential_adjusts() while cmd_count < len(sys.argv): arg = mt.nohy(sys.argv[cmd_count]) if i7.proj_exp(arg, False): if cmd_proj: sys.exit("Defined two command line projects. Bailing.") cmd_proj = i7.proj_exp(arg) elif arg in adjusts: if arg[0] == "+": instead_str += " " + adjusts[arg] else: instead_str = adjusts[arg] elif arg == "all": for x in sorted(adjusts): print(x, "->", adjusts[x]) else: usage() cmd_count += 1 print("Looking for adjusts:", instead_str) if cmd_proj: my_project = cmd_proj
return print("Changes found, copying back.") copy(my_bak, my_file) else: print("Use -c to copy over.") os.remove(my_bak) # start main my_default_proj = i7.dir2proj() story_file_only = False cmd_defined_proj = "" cmd_count = 1 while cmd_count < len(sys.argv): arg = nohy(sys.argv[cmd_count]) if arg == 'd': show_dif = True elif arg in i7.i7x: cmd_defined_proj = arg elif arg == 'f': force_copy = True elif arg == 'xv' or arg == 'vx': very_verbose = verbose = True elif arg == 'v': verbose = True elif arg == 'so': story_only = True elif arg == 'all' or arg == 'a': story_only = False elif arg == '?': usage() elif arg in i7x: if cmd_defined_proj: sys.exit("Redefined project from {:s} to {:s}.".format(cmd_defined_proj, i7.proj_exp(arg))) i7.go_proj(arg) cmd_defined_proj = i7.proj_exp(arg) else: usage("Invalid parameter " + arg) cmd_count += 1