X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=check_copyright.py;h=c7781f45e606fec7eedecd5df2baa76b9a3a545c;hb=b6b797f05fc065f550268dcfa8fc66273a2a7a44;hp=49775fe57f120ff9a84d631a4902f876e2530f48;hpb=6527cd5d3063b2724b60b3f87ed1105244b74cb3;p=modules%2Fhydro.git diff --git a/check_copyright.py b/check_copyright.py index 49775fe5..c7781f45 100644 --- a/check_copyright.py +++ b/check_copyright.py @@ -13,20 +13,20 @@ def check_file( theFile ): #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] aSecondLine = aLines[1][:-1] if( aFirstLine != theCopyright_line1 or aSecondLine != theCopyright_line2 ): - print 'Incorrect copyright in the', theFile + 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: