def main(): if "-h" in sys.argv or "--help" in sys.argv: usage() if len(sys.argv) != 3: print "Error: Missing argument(s)\n" usage() field_name = sys.argv[1] subst_str = sys.argv[2] lines = find_refs.get_compile_errors(field_name, 0, keep_tempfiles=1) ref_list = find_refs.parse_errors(lines, field_name, field_name) for ref in ref_list: patch_ref(ref, subst_str)
def main(): if '-h' in sys.argv or '--help' in sys.argv: usage() if len(sys.argv) != 3: print "Error: Missing argument(s)\n" usage() field_name = sys.argv[1] subst_str = sys.argv[2] lines = find_refs.get_compile_errors(field_name, 0, keep_tempfiles=1) ref_list = find_refs.parse_errors(lines, field_name, field_name) for ref in ref_list: patch_ref(ref, subst_str)
def main(): if '-h' in sys.argv or '--help' in sys.argv: usage() if len(sys.argv)!=2: print "Error: Missing <field_name>\n" usage() field_name = sys.argv[1] lines = find_refs.get_compile_errors(keep_tempfiles=1) ref_list = find_refs.parse_errors(lines, field_name) assign_from_pat = assign_from_pat_fmt % field_name for ref in ref_list: print "src_line='%s'" % ref.src_line m = re.search(assign_from_pat, ref.src_line) if m: print " at %s:%s" % (ref.filename, ref.line_no) assign_target = m.groups()[0] print " possible assignment to '%s' from '%s'" % (assign_target, field_name)
def main(): if '-h' in sys.argv or '--help' in sys.argv: usage() if len(sys.argv) != 2: print "Error: Missing <field_name>\n" usage() field_name = sys.argv[1] lines = find_refs.get_compile_errors(keep_tempfiles=1) ref_list = find_refs.parse_errors(lines, field_name) assign_from_pat = assign_from_pat_fmt % field_name for ref in ref_list: print "src_line='%s'" % ref.src_line m = re.search(assign_from_pat, ref.src_line) if m: print " at %s:%s" % (ref.filename, ref.line_no) assign_target = m.groups()[0] print " possible assignment to '%s' from '%s'" % (assign_target, field_name)