cstype is no longer optional, update creation
This commit is contained in:
parent
360d36fa94
commit
0ad9ec320a
4 changed files with 21 additions and 12 deletions
10
scripts/fck
10
scripts/fck
|
@ -5,10 +5,14 @@
|
|||
+---------------------------------+
|
||||
"""
|
||||
|
||||
from typing import Optional
|
||||
import argparse
|
||||
from multiprocessing import Pool
|
||||
from fck import checker, fileutils
|
||||
from fck import fileutils
|
||||
|
||||
def check_file(path: str, bigfile: bool, cstype: str = "") -> Optional[bool]:
|
||||
file = fileutils.new_file(path, cstype)
|
||||
return file.check(bigfile)
|
||||
|
||||
def main() -> None:
|
||||
"""
|
||||
|
@ -34,8 +38,8 @@ def main() -> None:
|
|||
|
||||
file_list = fileutils.search(args.files)
|
||||
ppool = Pool(processes=args.processes)
|
||||
file_list_checked = ppool.starmap(checker.check, [(x, args.bigfiles)
|
||||
for x in list(file_list)])
|
||||
file_list_checked = ppool.starmap(check_file, [(fpath, args.bigfiles, args.type)
|
||||
for fpath in list(file_list)])
|
||||
ppool.close()
|
||||
print(f"[{len([x for x in file_list_checked if x])}/{len(file_list_checked)}] Files passed")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue