Salome HOME
refs #497: redesign of HYDRO main menu.
[modules/hydro.git] / check_copyright.py
1
2 import os
3
4 theCopyright = '// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE'
5
6 def check_file( theFile ):
7   global files
8   #print 'Checking %s...' % theFile
9   aLines = open( theFile, 'r' ).readlines()
10   if( len( aLines )==0 ):
11     print 'Empty file: ', theFile
12     return False
13
14   aFirstLine = aLines[0][:-1]
15   if( aFirstLine != theCopyright ):
16     print 'Incorrect copyright in the', theFile
17     #print aFirstLine
18     #print theCopyright
19  
20
21 def check_folder( theFolder ):
22   aFiles = os.listdir( theFolder ); 
23   aHeaders = filter( lambda x: x.endswith('.h'), aFiles );
24   aSources = filter( lambda x: x.endswith('.cxx'), aFiles );
25   aSIPs = filter( lambda x: x.endswith('.sip'), aFiles );
26   for aHeader in aHeaders:
27     check_file( theFolder + '/' + aHeader )
28   for aSource in aSources:
29     check_file( theFolder + '/' + aSource )
30   for aSIP in aSIPs:
31     check_file( theFolder + '/' + aSIP )
32
33
34 check_folder( 'src/HYDROData' )
35 check_folder( 'src/HYDROGUI' )
36 check_folder( 'src/HYDROPy' )