示例#1
0
            print "ERROR: Parse of test run config file",file,"failed"
            print "       Unable to parse line:"
            print line
            inputfile.close()
            sys.exit(1)
        # end if

        # strip the white space from the key/value pairs
        for i in range(0,2) :
            pair[i] = pair[i].strip()
        # end for
        
        # run name
        if re.match(r'^TH_RUN_NAME$',pair[0]) :
            dprint(3,"   * Found run name " + pair[1])
            test_run.name = pair[1]
            continue
        # end if

        # load up the DB connection info if the key/values are found
        if re.match(r'^TH_DBNAME$',pair[0]) :
            test_run.db_conn['TH_DBNAME'] = pair[1]
            dprint(3,"   * Found db_conn var TH_DBNAME = " + pair[1])
            continue
        # end if
        if re.match(r'^TH_DBHOST$',pair[0]) :
            test_run.db_conn['TH_DBHOST'] = pair[1]
            dprint(3,"   * Found db_conn var TH_DBHOST = " + pair[1])
            continue
        # end if
        if re.match(r'^TH_DBUSER$',pair[0]) :
            print "ERROR: Parse of test run config file", file, "failed"
            print "       Unable to parse line:"
            print line
            inputfile.close()
            sys.exit(1)
        # end if

        # strip the white space from the key/value pairs
        for i in range(0, 2):
            pair[i] = pair[i].strip()
        # end for

        # run name
        if re.match(r'^TH_RUN_NAME$', pair[0]):
            dprint(3, "   * Found run name " + pair[1])
            test_run.name = pair[1]
            continue
        # end if

        # load up the DB connection info if the key/values are found
        if re.match(r'^TH_DBNAME$', pair[0]):
            test_run.db_conn['TH_DBNAME'] = pair[1]
            dprint(3, "   * Found db_conn var TH_DBNAME = " + pair[1])
            continue
        # end if
        if re.match(r'^TH_DBHOST$', pair[0]):
            test_run.db_conn['TH_DBHOST'] = pair[1]
            dprint(3, "   * Found db_conn var TH_DBHOST = " + pair[1])
            continue
        # end if
        if re.match(r'^TH_DBUSER$', pair[0]):