tooling(restep): fix ref error, none union lff_result
This commit is contained in:
parent
c71997b4f4
commit
31528d545e
10
sync.py
10
sync.py
|
@ -56,12 +56,15 @@ class CopyHighway:
|
||||||
multithreaded file copying class that gives a copy2-like function
|
multithreaded file copying class that gives a copy2-like function
|
||||||
for use with shutil.copytree(); also displays a progress bar
|
for use with shutil.copytree(); also displays a progress bar
|
||||||
"""
|
"""
|
||||||
|
|
||||||
pool: ThreadPool
|
pool: ThreadPool
|
||||||
pbar: tqdm
|
pbar: tqdm
|
||||||
lff_result: LargeFileFilterResult
|
lff_result: LargeFileFilterResult | None
|
||||||
respect_ignore: bool = True
|
respect_ignore: bool = True
|
||||||
|
|
||||||
def __init__(self, message: str, total: int, lff_result: LargeFileFilterResult):
|
def __init__(
|
||||||
|
self, message: str, total: int, lff_result: LargeFileFilterResult | None
|
||||||
|
):
|
||||||
"""
|
"""
|
||||||
multithreaded file copying class that gives a copy2-like function
|
multithreaded file copying class that gives a copy2-like function
|
||||||
for use with shutil.copytree()
|
for use with shutil.copytree()
|
||||||
|
@ -93,7 +96,7 @@ class CopyHighway:
|
||||||
def copy2(self, source: Path | str, dest: Path | str) -> None:
|
def copy2(self, source: Path | str, dest: Path | str) -> None:
|
||||||
"""shutil.copy2()-like function for use with shutil.copytree()"""
|
"""shutil.copy2()-like function for use with shutil.copytree()"""
|
||||||
|
|
||||||
if self.respect_ignore:
|
if self.respect_ignore and (self.lff_result is not None):
|
||||||
# ignore check 1: dir
|
# ignore check 1: dir
|
||||||
for ign_dir in self.lff_result.ignore_directories:
|
for ign_dir in self.lff_result.ignore_directories:
|
||||||
if str(ign_dir) in str(source):
|
if str(ign_dir) in str(source):
|
||||||
|
@ -434,6 +437,7 @@ def main() -> None:
|
||||||
print("1 pre | finding large files", end="", flush=True)
|
print("1 pre | finding large files", end="", flush=True)
|
||||||
files, sim = iter_files(REPO_DIR)
|
files, sim = iter_files(REPO_DIR)
|
||||||
|
|
||||||
|
flf_filter_result: LargeFileFilterResult | None = None
|
||||||
if "--skipsotaignoregen" not in argv:
|
if "--skipsotaignoregen" not in argv:
|
||||||
flf_filter_result = find_large_files(files, sim)
|
flf_filter_result = find_large_files(files, sim)
|
||||||
large_files = flf_filter_result.files
|
large_files = flf_filter_result.files
|
||||||
|
|
Reference in a new issue