diff --git a/addonmanager_dependency_installer.py b/addonmanager_dependency_installer.py index 89986b2..03bd557 100644 --- a/addonmanager_dependency_installer.py +++ b/addonmanager_dependency_installer.py @@ -107,7 +107,7 @@ def _verify_pip(self) -> bool: no_pip signal if pip cannot execute.""" try: proc = self._run_pip(["--version"]) - fci.Console.PrintMessage(proc.stdout + "\n") + fci.Console.PrintLog(proc.stdout + "\n") if proc.returncode != 0: return False except subprocess.CalledProcessError: @@ -134,7 +134,7 @@ def _install_required(self, vendor_path: str) -> bool: pymod, ] ) - fci.Console.PrintMessage(proc.stdout + "\n") + fci.Console.PrintLog(proc.stdout + "\n") except subprocess.CalledProcessError as e: fci.Console.PrintError(str(e) + "\n") self.failure.emit( @@ -162,7 +162,7 @@ def _install_optional(self, vendor_path: str): pymod, ] ) - fci.Console.PrintMessage(proc.stdout + "\n") + fci.Console.PrintLog(proc.stdout + "\n") except subprocess.CalledProcessError as e: fci.Console.PrintError( translate("AddonsInstaller", "Installation of optional package failed") diff --git a/addonmanager_installation_manifest.py b/addonmanager_installation_manifest.py index b38940d..7b56da9 100644 --- a/addonmanager_installation_manifest.py +++ b/addonmanager_installation_manifest.py @@ -103,7 +103,7 @@ def _migrate_to_manifest_file(self, catalog: AddonCatalog): "freecad_version": "", } else: - fci.Console.PrintMessage("Migrate to Manifest, skipping file: " + addon_id + "\n") + fci.Console.PrintLog("Migrate to Manifest, skipping file: " + addon_id + "\n") def load_manifest(self): """Load the manifest from the disk""" @@ -125,11 +125,13 @@ def _scan_mod_path_for_extras(self, catalog: AddonCatalog): branches = catalog.get_available_branches(addon_id) if not branches: if "backup" in addon_id: - fci.Console.PrintMessage("Found old backup directory: " + addon_id + "\n") + fci.Console.PrintLog("Found old backup directory: " + addon_id + "\n") self.old_backups.append(addon_id) else: fci.Console.PrintMessage( - "Found addon not in main AM catalog: " + addon_id + "\n" + "Found installed addon that is not in the official index: " + + addon_id + + "\n" ) self.unrecognized_directories.append(addon_id) diff --git a/addonmanager_installer_gui.py b/addonmanager_installer_gui.py index ac923b2..642fccc 100644 --- a/addonmanager_installer_gui.py +++ b/addonmanager_installer_gui.py @@ -87,7 +87,7 @@ def shutdown(self): def _stop_thread(thread: QtCore.QThread): if thread and hasattr(thread, "quit"): if thread.isRunning(): - fci.Console.PrintMessage( + fci.Console.PrintWarning( "INTERNAL ERROR: a QThread is still running when it should have finished" ) @@ -358,7 +358,7 @@ def _install_toolbar_button(self) -> None: if custom_toolbar: self._install_macro_to_toolbar(custom_toolbar) else: - fci.Console.PrintMessage("In the end, no custom toolbar was set, bailing out\n") + fci.Console.PrintWarning("In the end, no custom toolbar was set, bailing out\n") def _install_macro_to_toolbar(self, toolbar) -> None: """Adds an icon for the given macro to the given toolbar.""" @@ -389,7 +389,7 @@ def _install_macro_to_toolbar(self, toolbar) -> None: f.write(self.addon_to_install.macro.icon_data) pixmap_text = icon_file else: - fci.Console.PrintMessage( + fci.Console.PrintLog( f"No cached icon data for {self.addon_to_install.macro.name}\n" ) pixmap_text = None @@ -450,7 +450,7 @@ def shutdown(self): def _stop_thread(thread: QtCore.QThread): if thread and hasattr(thread, "quit"): if thread.isRunning(): - fci.Console.PrintMessage( + fci.Console.PrintWarning( "INTERNAL ERROR: a QThread is still running when it should have finished" ) diff --git a/addonmanager_macro_parser.py b/addonmanager_macro_parser.py index ed3eca9..15285ed 100644 --- a/addonmanager_macro_parser.py +++ b/addonmanager_macro_parser.py @@ -204,7 +204,7 @@ def _cleanup_comment(self): def _cleanup_license(self): if len(self.parse_results["license"].strip()) == 0: - fci.Console.PrintWarning( + fci.Console.PrintLog( f"No license specified for macro {self.name} -- assuming 'All rights reserved'.\n" ) self.parse_results["license"] = "All rights reserved" @@ -213,12 +213,12 @@ def _cleanup_license(self): lm = get_license_manager() normed_license = lm.normalize(self.parse_results["license"]) if not normed_license: - fci.Console.PrintWarning( + fci.Console.PrintLog( f"Failed to normalize license '{self.parse_results['license']}' for macro '{self.name}'\n" ) return elif normed_license != self.parse_results["license"]: - fci.Console.PrintMessage( + fci.Console.PrintLog( f"Normalized license '{self.parse_results['license']}' for macro '{self.name}' to {normed_license}\n" ) self.parse_results["license"] = normed_license diff --git a/addonmanager_workers_startup.py b/addonmanager_workers_startup.py index b945bac..91edf0e 100644 --- a/addonmanager_workers_startup.py +++ b/addonmanager_workers_startup.py @@ -489,7 +489,7 @@ def process_addon_cache(self, catalog_text_data): if name_of_first_entry is None: name_of_first_entry = branch_display_name else: - fci.Console.PrintMessage( + fci.Console.PrintLog( f"Found additional branch '{branch_display_name}' for addon {addon_id}\n" ) except Exception as e: @@ -939,5 +939,8 @@ def run(self): message += f"Missing required Python packages: {len(md.python_requires)}\n" message += f"Missing optional Python packages: {len(md.python_optional)}\n" message += f"Minimum required Python version evaluated to {md.python_min_version}\n\n" - fci.Console.PrintMessage(message) + if len(md.wbs) + len(md.external_addons) + len(md.python_requires) > 0: + fci.Console.PrintMessage(message) + else: + fci.Console.PrintLog(message) fci.Console.PrintLog(details)