Addon Manager: Additional diagnostics for Macro updates

This commit is contained in:
Chris Hennes
2022-06-06 11:46:56 -05:00
parent 3db5aba499
commit 79ac3eeb4d
2 changed files with 5 additions and 0 deletions

View File

@@ -1473,6 +1473,8 @@ class CommandAddonManager:
def update_progress_bar(self, current_value: int, max_value: int) -> None:
"""Update the progress bar, showing it if it's hidden"""
max_value = max_value if max_value > 0 else 1
if current_value < 0:
current_value = 0
elif current_value > max_value:

View File

@@ -628,6 +628,7 @@ class FillMacroListWorker(QtCore.QThread):
try:
if os.path.exists(self.repo_dir):
if not os.path.exists(os.path.join(self.repo_dir, ".git")):
FreeCAD.Console.PrintWarning(translate("AddonsInstaller","Attempting to change non-git Macro setup to use git\n"))
utils.repair_git_repo(
"https://github.com/FreeCAD/FreeCAD-macros.git", self.repo_dir
)
@@ -644,6 +645,8 @@ class FillMacroListWorker(QtCore.QThread):
)
+ f":\n{e}\n"
)
FreeCAD.Console.PrintWarning(f"{self.repo_dir}\n")
return
n_files = 0
for _, _, filenames in os.walk(self.repo_dir):
n_files += len(filenames)