Browse Source

Merge branch 'CURA-6627_Store_extra_data_project_files' of github.com:Ultimaker/Cura into CURA-6627_Store_extra_data_project_files

Jaime van Kessel 5 years ago
parent
commit
57648e2bb0

+ 1 - 0
.github/workflows/cicd.yml

@@ -6,6 +6,7 @@ on:
       - master
       - 'WIP**'
       - '4.*'
+      - 'CURA-*'
   pull_request:
 jobs:
   build:

+ 7 - 0
cmake/CuraTests.cmake

@@ -56,6 +56,13 @@ function(cura_add_test)
     endif()
 endfunction()
 
+#Add test for import statements which are not compatible with all builds
+add_test(
+    NAME "invalid-imports"
+    COMMAND ${Python3_EXECUTABLE} scripts/check_invalid_imports.py
+    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+)
+
 cura_add_test(NAME pytest-main DIRECTORY ${CMAKE_SOURCE_DIR}/tests PYTHONPATH "${CMAKE_SOURCE_DIR}|${URANIUM_DIR}")
 
 file(GLOB_RECURSE _plugins plugins/*/__init__.py)

+ 1 - 1
cura/Arranging/Arrange.py

@@ -69,7 +69,7 @@ class Arrange:
             points = copy.deepcopy(vertices._points)
 
             # After scaling (like up to 0.1 mm) the node might not have points
-            if not points:
+            if not points.size:
                 continue
 
             shape_arr = ShapeArray.fromPolygon(points, scale = scale)

+ 15 - 9
cura/CuraApplication.py

@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Ultimaker B.V.
+# Copyright (c) 2020 Ultimaker B.V.
 # Cura is released under the terms of the LGPLv3 or higher.
 
 import os
@@ -1827,15 +1827,21 @@ class CuraApplication(QtApplication):
 
     def _onContextMenuRequested(self, x: float, y: float) -> None:
         # Ensure we select the object if we request a context menu over an object without having a selection.
-        if not Selection.hasSelection():
-            node = self.getController().getScene().findObject(cast(SelectionPass, self.getRenderer().getRenderPass("selection")).getIdAtPosition(x, y))
-            if node:
-                parent = node.getParent()
-                while(parent and parent.callDecoration("isGroup")):
-                    node = parent
-                    parent = node.getParent()
+        if Selection.hasSelection():
+            return
+        selection_pass = cast(SelectionPass, self.getRenderer().getRenderPass("selection"))
+        if not selection_pass:  # If you right-click before the rendering has been initialised there might not be a selection pass yet.
+            print("--------------ding! Got the crash.")
+            return
+        node = self.getController().getScene().findObject(selection_pass.getIdAtPosition(x, y))
+        if not node:
+            return
+        parent = node.getParent()
+        while parent and parent.callDecoration("isGroup"):
+            node = parent
+            parent = node.getParent()
 
-                Selection.add(node)
+        Selection.add(node)
 
     @pyqtSlot()
     def showMoreInformationDialogForAnonymousDataCollection(self):

+ 1 - 1
cura/CuraPackageManager.py

@@ -15,7 +15,7 @@ if TYPE_CHECKING:
 
 
 class CuraPackageManager(PackageManager):
-    def __init__(self, application: "QtApplication", parent: Optional["QObject"] = None):
+    def __init__(self, application: "QtApplication", parent: Optional["QObject"] = None) -> None:
         super().__init__(application, parent)
 
     def initialize(self) -> None:

+ 1 - 1
cura/Machines/Models/MaterialBrandsModel.py

@@ -34,7 +34,7 @@ class MaterialBrandsModel(BaseMaterialsModel):
         brand_item_list = []
         brand_group_dict = {}
 
-        # Part 1: Generate the entire tree of brands -> material types -> spcific materials
+        # Part 1: Generate the entire tree of brands -> material types -> specific materials
         for root_material_id, container_node in self._available_materials.items():
             # Do not include the materials from a to-be-removed package
             if bool(container_node.getMetaDataEntry("removed", False)):

+ 1 - 1
cura/Machines/VariantNode.py

@@ -51,7 +51,7 @@ class VariantNode(ContainerNode):
         # Find all the materials for this variant's name.
         else:  # Printer has its own material profiles. Look for material profiles with this printer's definition.
             base_materials = container_registry.findInstanceContainersMetadata(type = "material", definition = "fdmprinter")
-            printer_specific_materials = container_registry.findInstanceContainersMetadata(type = "material", definition = self.machine.container_id, variant_name = None)
+            printer_specific_materials = container_registry.findInstanceContainersMetadata(type = "material", definition = self.machine.container_id)
             variant_specific_materials = container_registry.findInstanceContainersMetadata(type = "material", definition = self.machine.container_id, variant_name = self.variant_name)  # If empty_variant, this won't return anything.
             materials_per_base_file = {material["base_file"]: material for material in base_materials}
             materials_per_base_file.update({material["base_file"]: material for material in printer_specific_materials})  # Printer-specific profiles override global ones.

+ 1 - 1
cura/OneAtATimeIterator.py

@@ -122,6 +122,6 @@ class _ObjectOrder:
     #   \param order List of indices in which to print objects, ordered by printing
     #   order.
     #   \param todo: List of indices which are not yet inserted into the order list.
-    def __init__(self, order: List[SceneNode], todo: List[SceneNode]):
+    def __init__(self, order: List[SceneNode], todo: List[SceneNode]) -> None:
         self.order = order
         self.todo = todo

+ 1 - 1
cura/Operations/PlatformPhysicsOperation.py

@@ -8,7 +8,7 @@ from UM.Scene.SceneNode import SceneNode
 
 ##  A specialised operation designed specifically to modify the previous operation.
 class PlatformPhysicsOperation(Operation):
-    def __init__(self, node: SceneNode, translation: Vector):
+    def __init__(self, node: SceneNode, translation: Vector) -> None:
         super().__init__()
         self._node = node
         self._old_transformation = node.getLocalTransformation()

+ 1 - 1
cura/Operations/SetParentOperation.py

@@ -14,7 +14,7 @@ class SetParentOperation(Operation.Operation):
     #
     #   \param node The node which will be reparented.
     #   \param parent_node The node which will be the parent.
-    def __init__(self, node: SceneNode, parent_node: Optional[SceneNode]):
+    def __init__(self, node: SceneNode, parent_node: Optional[SceneNode]) -> None:
         super().__init__()
         self._node = node
         self._parent = parent_node

Some files were not shown because too many files changed in this diff