Salome HOME
[fix] Corrections for version value
[modules/hydro.git] / check_copyright.py
index c1353dac85d6b3b8c2632e031d361dd9c07b3096..c7781f45e606fec7eedecd5df2baa76b9a3a545c 100644 (file)
@@ -1,28 +1,32 @@
 
 import os
 
-theCopyright = '// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE'
+theCopyright_line1 = '// Copyright (C) 2014-2015  EDF-R&D'
+theCopyright_line2 = '// This library is free software; you can redistribute it and/or'
 
 def check_file( theFile ):
   global files
+
+  if theFile=='src/HYDRO_tests/test_HYDROData_LandCoverMap.cxx':
+    return True; #in the file the unicode is used
+
   #print 'Checking %s...' % theFile
   aLines = open( theFile, 'r' ).readlines()
   if( len( aLines )==0 ):
-    print 'Empty file: ', theFile
+    print('Empty file: ', theFile)
     return False
 
   aFirstLine = aLines[0][:-1]
-  if( aFirstLine != theCopyright ):
-    print 'Incorrect copyright in the', theFile
-    #print aFirstLine
-    #print theCopyright
+  aSecondLine = aLines[1][:-1]
+  if( aFirstLine != theCopyright_line1 or aSecondLine != theCopyright_line2 ):
+    print('Incorrect copyright in the', theFile)
  
 
 def check_folder( theFolder ):
   aFiles = os.listdir( theFolder ); 
-  aHeaders = filter( lambda x: x.endswith('.h'), aFiles );
-  aSources = filter( lambda x: x.endswith('.cxx'), aFiles );
-  aSIPs = filter( lambda x: x.endswith('.sip'), aFiles );
+  aHeaders = [x for x in aFiles if x.endswith('.h')];
+  aSources = [x for x in aFiles if x.endswith('.cxx')];
+  aSIPs = [x for x in aFiles if x.endswith('.sip')];
   for aHeader in aHeaders:
     check_file( theFolder + '/' + aHeader )
   for aSource in aSources:
@@ -34,3 +38,4 @@ def check_folder( theFolder ):
 check_folder( 'src/HYDROData' )
 check_folder( 'src/HYDROGUI' )
 check_folder( 'src/HYDROPy' )
+check_folder( 'src/HYDRO_tests' )