4 theCopyright_line1 = '// Copyright (C) 2014-2015 EDF-R&D'
5 theCopyright_line2 = '// This library is free software; you can redistribute it and/or'
7 def check_file( theFile ):
10 if theFile=='src/HYDRO_tests/test_HYDROData_LandCoverMap.cxx':
11 return True; #in the file the unicode is used
13 #print 'Checking %s...' % theFile
14 aLines = open( theFile, 'r' ).readlines()
15 if( len( aLines )==0 ):
16 print('Empty file: ', theFile)
19 aFirstLine = aLines[0][:-1]
20 aSecondLine = aLines[1][:-1]
21 if( aFirstLine != theCopyright_line1 or aSecondLine != theCopyright_line2 ):
22 print('Incorrect copyright in the', theFile)
25 def check_folder( theFolder ):
26 aFiles = os.listdir( theFolder );
27 aHeaders = [x for x in aFiles if x.endswith('.h')];
28 aSources = [x for x in aFiles if x.endswith('.cxx')];
29 aSIPs = [x for x in aFiles if x.endswith('.sip')];
30 for aHeader in aHeaders:
31 check_file( theFolder + '/' + aHeader )
32 for aSource in aSources:
33 check_file( theFolder + '/' + aSource )
35 check_file( theFolder + '/' + aSIP )
38 check_folder( 'src/HYDROData' )
39 check_folder( 'src/HYDROGUI' )
40 check_folder( 'src/HYDROPy' )
41 check_folder( 'src/HYDRO_tests' )