示例#1
0
            numbered_findings[0] = fhdr + "\n" + numbered_findings[0]
            for find in numbered_findings:
                ar.write_row(rx+1,id,cat,FINDING_TYPE,fhdr + find,u"".join(exd_observations),cause,"Cond2.1")
        elif not numbered_findings:
            ar.write_row(rx+1,id,cat,FINDING_TYPE,fhdr,u"".join(exd_observations),cause,"Cond1")
        else:
            #Cond4 - no such match. Dump findings and finding details and notify
            ar.write_row(rx+1,id,cat,FINDING_TYPE,finding,(d1 + "\n" + d2),cause,"Cond4: Neelansha Please look at it!")

        if fob and not fdob:
            ar.write_row(rx+1,id,cat,OBSERV_TYPE,fob,d1 + "\n" + d2,cause,"Cond5.1 observ")
        elif fob and fdob:
            ar.write_row(rx+1,id,cat,OBSERV_TYPE,fob,fdob,cause,"Cond5 observ")

    try:
        converter = XLConverter(book,ar.get_workbook(),config_file)
        converter.process()
        
        #get facility profile name from file
        (frow,fcol) = converter.decode_single_cell('B5')
        facility_name = facility_profile.cell_value(rowx=frow,colx=fcol).strip()
        facility_id = facility_mapper.get_facility_id(facility_name,2013)
        converter.write_value("Facility Profile","A1","Facility ID From MSS:")
        converter.write_value("Facility Profile","B1",facility_id)

        ar.save()
        logging.info('Written file: ' + ifile + ".xls")
    except:
        logging.error("Error processing file: " + ifile + ".No output written")
        
示例#2
0
文件: excel.py 项目: Janarthanam/proc
            for find in numbered_findings:
                ar.write_row(rx + 1, id, cat, FINDING_TYPE, fhdr + find, "".join(exd_observations), cause, "Cond2.1")
        elif not numbered_findings:
            ar.write_row(rx + 1, id, cat, FINDING_TYPE, fhdr, "".join(exd_observations), cause, "Cond1")
        else:
            # Cond4 - no such match. Dump findings and finding details and notify
            ar.write_row(
                rx + 1, id, cat, FINDING_TYPE, finding, (d1 + "\n" + d2), cause, "Cond4: Neelansha Please look at it!"
            )

        if fob and not fdob:
            ar.write_row(rx + 1, id, cat, OBSERV_TYPE, fob, d1 + "\n" + d2, cause, "Cond5.1 observ")
        elif fob and fdob:
            ar.write_row(rx + 1, id, cat, OBSERV_TYPE, fob, fdob, cause, "Cond5 observ")

    try:
        converter = XLConverter(book, ar.get_workbook(), "./config")
        converter.process()

        # get facility profile name from file
        (frow, fcol) = converter.decode_single_cell("B5")
        facility_name = facility_profile.cell_value(rowx=frow, colx=fcol).strip()
        facility_id = facility_mapper.get_facility_id(facility_name, 2013)
        converter.write_value("Facility Profile", "A1", "Facility ID From MSS:")
        converter.write_value("Facility Profile", "B1", facility_id)

        ar.save()
        logging.info("Written file: " + ifile + ".xls")
    except:
        logging.error("Error processing file: " + ifile + ".No output written")