mirror of
https://github.com/catchorg/Catch2.git
synced 2025-05-25 14:09:26 +00:00
Minor fixes to python scripts by pycodestyle
This commit is contained in:
parent
64be2ad96c
commit
9e7c281e6e
9 changed files with 35 additions and 33 deletions
|
@ -11,23 +11,23 @@ from scriptCommon import catchPath
|
|||
rootPath = os.path.join( catchPath, 'projects/SelfTest/Baselines' )
|
||||
|
||||
if len(sys.argv) > 1:
|
||||
files = [os.path.join( rootPath, f ) for f in sys.argv[1:]]
|
||||
files = [os.path.join( rootPath, f ) for f in sys.argv[1:]]
|
||||
else:
|
||||
files = glob.glob( os.path.join( rootPath, "*.unapproved.txt" ) )
|
||||
files = glob.glob( os.path.join( rootPath, "*.unapproved.txt" ) )
|
||||
|
||||
|
||||
def approveFile( approvedFile, unapprovedFile ):
|
||||
justFilename = unapprovedFile[len(rootPath)+1:]
|
||||
if os.path.exists( unapprovedFile ):
|
||||
if os.path.exists( approvedFile ):
|
||||
os.remove( approvedFile )
|
||||
os.rename( unapprovedFile, approvedFile )
|
||||
print( "approved " + justFilename )
|
||||
else:
|
||||
print( "approval file " + justFilename + " does not exist" )
|
||||
justFilename = unapprovedFile[len(rootPath)+1:]
|
||||
if os.path.exists( unapprovedFile ):
|
||||
if os.path.exists( approvedFile ):
|
||||
os.remove( approvedFile )
|
||||
os.rename( unapprovedFile, approvedFile )
|
||||
print( "approved " + justFilename )
|
||||
else:
|
||||
print( "approval file " + justFilename + " does not exist" )
|
||||
|
||||
if len(files) > 0:
|
||||
for unapprovedFile in files:
|
||||
approveFile( unapprovedFile.replace( "unapproved.txt", "approved.txt" ), unapprovedFile )
|
||||
if files:
|
||||
for unapprovedFile in files:
|
||||
approveFile( unapprovedFile.replace( "unapproved.txt", "approved.txt" ), unapprovedFile )
|
||||
else:
|
||||
print( "no files to approve" )
|
||||
print( "no files to approve" )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue