fix divide by 0 errors in --verbose output of progress tracking

This commit is contained in:
Rainchus 2024-09-18 17:13:34 -05:00
parent ed199a0e3a
commit ffa12177c1

View file

@ -1406,9 +1406,13 @@ def calculate_progress(config: ProjectConfig) -> None:
self.objects_progress += 1 self.objects_progress += 1
def code_frac(self) -> float: def code_frac(self) -> float:
if self.code_total == 0:
return 1.0
return self.code_progress / self.code_total return self.code_progress / self.code_total
def data_frac(self) -> float: def data_frac(self) -> float:
if self.data_total == 0:
return 1.0
return self.data_progress / self.data_total return self.data_progress / self.data_total
progress_units: Dict[str, ProgressUnit] = {} progress_units: Dict[str, ProgressUnit] = {}