@@ -21,7 +21,7 @@ def checkCSVcolumnCount():
2121 reader = csv .reader (open (f , "r" ))
2222 for row in reader :
2323 if not len (row ) == 6 :
24- print ("{ }: Insufficient columns of data - {}" . format ( filename , row ) )
24+ print (f" { filename } : Insufficient columns of data - { row } " )
2525 missing_csv_field = True
2626 continue
2727
@@ -30,6 +30,7 @@ def checkCSVcolumnCount():
3030 else :
3131 return 0
3232
33+
3334def checkFilenameLengths ():
3435 print ("SOUNDS: Checking file name lengths ..." )
3536 invalid_filename_found = False
@@ -38,12 +39,12 @@ def checkFilenameLengths():
3839 path = os .path .join (dirpath , fn )
3940 if path .split (os .path .sep )[2 ] == "SYSTEM" :
4041 if len (os .path .splitext (fn )[0 ]) > 8 :
41- print ("Filename too long for a SYSTEM file: {}" . format ( path ) )
42+ print (f "Filename too long for a SYSTEM file: { path } " )
4243 invalid_filename_found = True
4344 elif path .split (os .path .sep )[2 ] == "SCRIPTS" :
4445 continue
4546 elif len (os .path .splitext (fn )[0 ]) > 6 :
46- print ("Filename too long for a non-SYSTEM file: {}" . format ( path ) )
47+ print (f "Filename too long for a non-SYSTEM file: { path } " )
4748 invalid_filename_found = True
4849
4950 if invalid_filename_found :
@@ -60,7 +61,7 @@ def checkNoZeroByteFiles():
6061 for fn in files :
6162 path = os .path .join (root , fn )
6263 if os .stat (path ).st_size == 0 :
63- print ("Zero byte file: {}" . format ( path ) )
64+ print (f "Zero byte file: { path } " )
6465 zero_byte_file_found = True
6566
6667 if zero_byte_file_found :
@@ -76,14 +77,15 @@ def validateSoundsJson():
7677 try :
7778 json .load (f )
7879 except ValueError as err :
79- print ("JSON not valid: {}" . format ( str (err )) )
80+ print (f "JSON not valid: { str (err )} " )
8081 invalid_json_found = True
8182
8283 if invalid_json_found :
8384 return 1
8485 else :
8586 return 0
8687
88+
8789def checkForDuplicateStringID ():
8890 print ("VOICES: Check for duplicate StringIDs ..." )
8991 duplicate_found = False
@@ -111,7 +113,7 @@ def checkForDuplicateStringID():
111113 else :
112114 StringID = row [0 ]
113115 if StringID in StringID_count .keys ():
114- print ('{ }: {} is duplicated'. format ( f , StringID ) )
116+ print (f' { f } : { StringID } is duplicated' )
115117 StringID_count [StringID ] = StringID_count [StringID ] + 1
116118 duplicate_found = True
117119 else :
0 commit comments