def parse(op_file, d, index_line): if 'errMsge' in d: init.write_to_file(index_line + " - Student Not Found \n", op_file) return init.write_to_file( index_line + "," + d['name'] + "," + init.find(d['studentInfo'], "District / Medium Cut off Mark") + "," + d['subjectResults'][0]['subjectResult'] + "\n", op_file)
def parse(content, index_line, f): doc = xml.dom.minidom.parseString(content) lines = content.split("\n") matching_lines = [] for line in lines: m = re.search("(.*rightre\">)(.*)", line) if m: matching_lines.append(m.group(2)) init.write_to_file( ",".join(index_line.split(input_sep)[0:4]) + "," + matching_lines[2] + "," + matching_lines[4] + "," + matching_lines[5] + "\n", f)
def parse(op_file, d, index_line): if 'errMsge' in d: init.write_to_file( ",".join(index_line.split(init.input_sep)[0:7]) + " - Student Not Found \n", op_file) else: init.write_to_file( ",".join(index_line.split(init.input_sep)[0:7]) + "," + d['name'] + "," + ",".join( init.fill_marks(config[4], d['subjectResults'], index_line.split(init.input_sep)[6], 9)) + "\n", op_file)
def parse(content,index_line,f): elements = xml.dom.minidom.parseString(content).getElementsByTagName("td") mark_array = [""] * len(subjects) for x in range(10, len(elements), 2): subject = init.strip(elements[x].childNodes[0].data.replace("\n", "")) grade = init.strip(elements[x + 1].childNodes[0].data.replace("\n", "")) index = init.get_index(subjects,subject) if index is not None: mark_array[index] = grade else: print "Error for Subject " + subject init.write_to_file(",".join(index_line.split(input_sep)[0:4]) + "," + ",".join(mark_array) + "\n",f)
def parse(op_file, d, index_line): student_info = ",".join(index_line.split(init.input_sep)[0:8]) if 'errMsge' in d: init.write_to_file(student_info + " - Student Not Found \n", op_file) return s = "" for s_info in [ 'Name', 'Subject Stream', 'Syllabus', 'District Rank', 'Island Rank', 'Z-Score' ]: s = s + "," + init.find(d['studentInfo'], s_info) init.write_to_file( student_info + "," + s[1:] + "," + ",".join( init.fill_marks(config[4], d['subjectResults'], index_line.split(init.input_sep)[7], 5)) + "\n", op_file)
def parse(content, index_line, f): tables = xml.dom.minidom.parseString(content).getElementsByTagName("table") init.write_to_file( index_line.lstrip().rstrip() + "," + get_subject_stream(tables[0]) + "," + get_subject_wise_data(tables[1]) + "\n", f)