@@ -160,7 +160,7 @@ def probe_usm():
160
160
"path" : usmfile .replace (args .input , "" ),
161
161
"version" : wannacri .__version__ ,
162
162
"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 ,
164
164
},
165
165
)
166
166
@@ -320,23 +320,23 @@ def main():
320
320
OP_DICT [args .operation ]()
321
321
322
322
323
- def find_usm (path : str ) -> List [str ]:
323
+ def find_usm (directory : str ) -> List [str ]:
324
324
"""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 :
327
327
if not is_usm (test .read (4 )):
328
328
raise ValueError ("Not a usm file." )
329
329
330
- return [path ]
330
+ return [directory ]
331
331
332
332
print ("Finding USM files... " , end = "" , flush = True )
333
333
usmfiles = []
334
- for path , _ , files in os .walk (path ):
334
+ for path , _ , files in os .walk (directory ):
335
335
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 :
338
338
if is_usm (test .read (4 )):
339
- usmfiles .append (path )
339
+ usmfiles .append (filepath )
340
340
341
341
print (f"Found { len (usmfiles )} " )
342
342
return usmfiles
0 commit comments