@@ -160,7 +160,7 @@ def probe_usm():
160160 "path" : usmfile .replace (args .input , "" ),
161161 "version" : wannacri .__version__ ,
162162 "os" : f"{ platform .system ()} { platform .release ()} " ,
163- "is_local_ffprobe" : False if ffprobe_path is None else True ,
163+ "is_local_ffprobe" : ffprobe_path is not None ,
164164 },
165165 )
166166
@@ -320,23 +320,23 @@ def main():
320320 OP_DICT [args .operation ]()
321321
322322
323- def find_usm (path : str ) -> List [str ]:
323+ def find_usm (directory : str ) -> List [str ]:
324324 """Walks a path to find USMs."""
325- if os .path .isfile (path ):
326- with open (path , "rb" ) as test :
325+ if os .path .isfile (directory ):
326+ with open (directory , "rb" ) as test :
327327 if not is_usm (test .read (4 )):
328328 raise ValueError ("Not a usm file." )
329329
330- return [path ]
330+ return [directory ]
331331
332332 print ("Finding USM files... " , end = "" , flush = True )
333333 usmfiles = []
334- for path , _ , files in os .walk (path ):
334+ for path , _ , files in os .walk (directory ):
335335 for f in files :
336- path = os .path .join (path , f )
337- with open (path , "rb" ) as test :
336+ filepath = os .path .join (path , f )
337+ with open (filepath , "rb" ) as test :
338338 if is_usm (test .read (4 )):
339- usmfiles .append (path )
339+ usmfiles .append (filepath )
340340
341341 print (f"Found { len (usmfiles )} " )
342342 return usmfiles
0 commit comments