1 # -*- coding: utf-8 -*- 2 3 import sys 4 from log_parser import BatchResultParser 5 6 def batchResultToCsv (filename): 7 parser = BatchResultParser() 8 results = parser.parseFile(filename) 9 10 for result in results: 11 print "%s,%s" % (result.name, result.statusCode) 12 13 if __name__ == "__main__": 14 if len(sys.argv) != 2: 15 print "%s: [qpa log]" % sys.argv[0] 16 sys.exit(-1) 17 18 batchResultToCsv(sys.argv[1]) 19