mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-10 07:15:03 -06:00
Merge remote-tracking branch 'origin/gracefully_fail_cloud_printer' into 5.0
This commit is contained in:
commit
334fca6691
2 changed files with 22 additions and 13 deletions
|
@ -17,7 +17,7 @@ class CuraStackBuilder:
|
|||
"""Contains helper functions to create new machines."""
|
||||
|
||||
@classmethod
|
||||
def createMachine(cls, name: str, definition_id: str, machine_extruder_count: Optional[int] = None) -> Optional[GlobalStack]:
|
||||
def createMachine(cls, name: str, definition_id: str, machine_extruder_count: Optional[int] = None, show_warning_message: bool = True) -> Optional[GlobalStack]:
|
||||
"""Create a new instance of a machine.
|
||||
|
||||
:param name: The name of the new machine.
|
||||
|
@ -34,7 +34,8 @@ class CuraStackBuilder:
|
|||
|
||||
definitions = registry.findDefinitionContainers(id = definition_id)
|
||||
if not definitions:
|
||||
ConfigurationErrorMessage.getInstance().addFaultyContainers(definition_id)
|
||||
if show_warning_message:
|
||||
ConfigurationErrorMessage.getInstance().addFaultyContainers(definition_id)
|
||||
Logger.log("w", "Definition {definition} was not found!", definition = definition_id)
|
||||
return None
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue