cstype is no longer optional, update creation

This commit is contained in:
Kevin Baensch 2024-11-23 23:12:35 +01:00
parent 360d36fa94
commit 0ad9ec320a
Signed by: derped
GPG key ID: C0F1D326C7626543
4 changed files with 21 additions and 12 deletions

View file

@ -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")