From b8bf3f619cbbf065cb5617e4bde93a6b9fdb141f Mon Sep 17 00:00:00 2001 From: Masaru Tsuchiyama Date: Sat, 7 Jul 2018 15:08:33 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=A1=E3=82=A4=E3=83=B3=E3=81=AE=E5=87=A6?= =?UTF-8?q?=E7=90=86=E3=82=92=20main()=20=E3=81=AB=E7=BA=8F=E3=82=81?= =?UTF-8?q?=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parse-buildlog.py | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/parse-buildlog.py b/parse-buildlog.py index 91938a1725..8959a09963 100644 --- a/parse-buildlog.py +++ b/parse-buildlog.py @@ -26,6 +26,19 @@ 'message', ] +# main 関数 +def main(): + if len(sys.argv) < 2: + print ("usage: " + sys.argv[0] + " ") + sys.exit(1) + + infile = sys.argv[1] + outcsvfile = infile + '.csv' + + data = parse_buildlog(infile) + writeToCSV(outcsvfile, data) + + # infile: msbuild のビルドログ・ファイル名 # 戻り値: ログの解析結果が入ったハッシュの配列 def parse_buildlog(infile): @@ -120,12 +133,4 @@ def writeToCSV(outfile, data): print ("wrote " + outfile) if __name__ == '__main__': - if len(sys.argv) < 2: - print ("usage: " + sys.argv[0] + " ") - sys.exit(1) - - infile = sys.argv[1] - outcsvfile = infile + '.csv' - - data = parse_buildlog(infile) - writeToCSV(outcsvfile, data) + main()