Skip to content

Commit

Permalink
メインの処理を main() に纏める
Browse files Browse the repository at this point in the history
  • Loading branch information
m-tmatma committed Jul 7, 2018
1 parent c6d39f3 commit b8bf3f6
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions parse-buildlog.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,19 @@
'message',
]

# main 関数
def main():
if len(sys.argv) < 2:
print ("usage: " + sys.argv[0] + " <logfile name>")
sys.exit(1)

infile = sys.argv[1]
outcsvfile = infile + '.csv'

data = parse_buildlog(infile)
writeToCSV(outcsvfile, data)


# infile: msbuild のビルドログ・ファイル名
# 戻り値: ログの解析結果が入ったハッシュの配列
def parse_buildlog(infile):
Expand Down Expand Up @@ -120,12 +133,4 @@ def writeToCSV(outfile, data):
print ("wrote " + outfile)

if __name__ == '__main__':
if len(sys.argv) < 2:
print ("usage: " + sys.argv[0] + " <logfile name>")
sys.exit(1)

infile = sys.argv[1]
outcsvfile = infile + '.csv'

data = parse_buildlog(infile)
writeToCSV(outcsvfile, data)
main()

0 comments on commit b8bf3f6

Please sign in to comment.