Only run warn.py's main function if it is the main program.
Test: run warn.py --byproject build.log Change-Id: I155cce8c952d6d8a02c8e1809bf61a46c847c26e
This commit is contained in:
@@ -2333,10 +2333,14 @@ def dump_csv():
|
|||||||
print '{},,{}'.format(total, 'All warnings')
|
print '{},,{}'.format(total, 'All warnings')
|
||||||
|
|
||||||
|
|
||||||
##### Main function starts here. #########################
|
def main():
|
||||||
|
|
||||||
parse_input_file()
|
parse_input_file()
|
||||||
if args.gencsv:
|
if args.gencsv:
|
||||||
dump_csv()
|
dump_csv()
|
||||||
else:
|
else:
|
||||||
dump_html()
|
dump_html()
|
||||||
|
|
||||||
|
|
||||||
|
# Run main function if warn.py is the main program.
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
||||||
|
Reference in New Issue
Block a user