Browse Source

Merge pull request #12769 from Ultimaker/CURA-9365_add_conan_info_to_log

CURA 9365 add conan info to log
Joey de l'Arago 2 years ago
parent
commit
d1453c5f69
2 changed files with 17 additions and 0 deletions
  1. 11 0
      cura/ApplicationMetadata.py
  2. 6 0
      cura/CuraApplication.py

+ 11 - 0
cura/ApplicationMetadata.py

@@ -60,3 +60,14 @@ try:
 
 except ImportError:
     CuraAppDisplayName = DEFAULT_CURA_DISPLAY_NAME
+
+DEPENDENCY_INFO = {}
+try:
+    from pathlib import Path
+    conan_install_info = Path(__file__).parent.parent.joinpath("conan_install_info.json")
+    if conan_install_info.exists():
+        import json
+        with open(conan_install_info, "r") as f:
+            DEPENDENCY_INFO = json.loads(f.read())
+except:
+    pass

+ 6 - 0
cura/CuraApplication.py

@@ -820,6 +820,12 @@ class CuraApplication(QtApplication):
     def run(self):
         super().run()
 
+        if len(ApplicationMetadata.DEPENDENCY_INFO) > 0:
+            Logger.debug("Using Conan managed dependencies: " + ", ".join(
+                [dep["recipe"]["id"] for dep in ApplicationMetadata.DEPENDENCY_INFO["installed"] if dep["recipe"]["version"] != "latest"]))
+        else:
+            Logger.warning("Could not find conan_install_info.json")
+
         Logger.log("i", "Initializing machine error checker")
         self._machine_error_checker = MachineErrorChecker(self)
         self._machine_error_checker.initialize()