Exemplo n.º 1
0
def get_dot_method_map(proj_lst):
    dot_method_map = {}
    for proj in proj_lst:
        output_dir_lst = dot.dot_dirs(proj)
        for output_dir in output_dir_lst:
            method_file = dot.get_method_path(proj, output_dir)
            with open(method_file, "r") as mf:
                for line in mf:
                    line = line.rstrip()
                    items = line.split("\t")
                    method_name = items[0]
                    method_dot = items[1]
                    method_dot_path = dot.get_dot_path(proj, output_dir,
                                                       method_dot)
                    dot_method_map[method_dot_path] = method_name
    return dot_method_map
Exemplo n.º 2
0
def get_method_map(project_list):
    dot_to_method_map = {}
    for project in project_list:
        for output_dir in dot.dot_dirs(project):
            #output_dir = dot.dot_dirs(project)[0] # first folder only for now
            method_file = dot.get_method_path(project, output_dir)
            if not os.path.isfile(method_file):
                print("Cannot find method file for project {0} at {1}".format(
                    project, method_file))
                sys.exit(0)

            with open(method_file, "r") as mf:
                content = mf.readlines()
                for line in content:
                    line = line.rstrip()
                    items = line.split('\t')
                    method_name = items[0]
                    method_dot = items[1]
                    method_dot_path = dot.get_dot_path(project, output_dir,
                                                       method_dot)
                    dot_to_method_map[method_dot_path] = method_name
    return dot_to_method_map