Minor fixes to python scripts by pycodestyle

This commit is contained in:
Marcus Näslund authored and Martin Hořeňovský committed 2018-04-27 18:57:18 +02:00
1 parent 64be2ad96c
commit 9e7c281e6e
9 files changed
+35 -33

No files matched your search

+7 -4
View File
@@ -4,19 +4,20 @@ from __future__ import print_function
import os
from scriptCommon import catchPath
changedFiles = 0
def isSourceFile( path ):
return path.endswith( ".cpp" ) or path.endswith( ".h" ) or path.endswith( ".hpp" )
def fixAllFilesInDir( dir ):
changedFiles = 0
for f in os.listdir( dir ):
path = os.path.join( dir,f )
if os.path.isfile( path ):
if isSourceFile( path ):
fixFile( path )
if fixFile( path ):
changedFiles += 1
else:
fixAllFilesInDir( path )
return changedFiles
def fixFile( path ):
f = open( path, 'r' )
@@ -41,8 +42,10 @@ def fixFile( path ):
f2.write( line )
f2.close()
os.remove( altPath )
return True
return False
fixAllFilesInDir(catchPath)
changedFiles = fixAllFilesInDir(catchPath)
if changedFiles > 0:
print( "Fixed " + str(changedFiles) + " file(s)" )
else: