Extensions: suppress warnings when repository directories don't exist

Re-calculating statistics for outdated packages printed exceptions
whenever the repository directory didn't exist.
This commit is contained in:
Campbell Barton
2024-06-10 22:39:04 +10:00
parent a799c84946
commit c0754209ef

View File

@@ -174,6 +174,7 @@ def repo_stats_calc():
if bpy.app.background:
return
import os
package_count = 0
for repo_item in bpy.context.preferences.extensions.repos:
@@ -184,7 +185,14 @@ def repo_stats_calc():
if not repo_item.remote_url:
continue
package_count += repo_stats_calc_outdated_for_repo_directory(repo_item.directory)
# If the directory is missing, ignore it.
# Otherwise users may be bothered with errors from unrelated repositories
# because calculating status currently runs after many actions.
repo_directory = repo_item.directory
if not os.path.isdir(repo_directory):
continue
package_count += repo_stats_calc_outdated_for_repo_directory(repo_directory)
bpy.context.window_manager.extensions_updates = package_count