From 12c50dbac8179b92272136c512e034f6782027df Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Mon, 20 Mar 2017 17:26:12 +0100 Subject: [PATCH] Introduce a GlobalStack class This will allow us to codify some of the assumptions made about the global stack Contributes to CURA-3497 --- cura/Settings/GlobalStack.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 cura/Settings/GlobalStack.py diff --git a/cura/Settings/GlobalStack.py b/cura/Settings/GlobalStack.py new file mode 100644 index 0000000000..a2a7ae59dd --- /dev/null +++ b/cura/Settings/GlobalStack.py @@ -0,0 +1,22 @@ +# Copyright (c) 2017 Ultimaker B.V. +# Cura is released under the terms of the AGPLv3 or higher. + +from UM.MimeTypeDatabase import MimeType, MimeTypeDatabase +from UM.Settings.ContainerStack import ContainerStack +from UM.Settings.ContainerRegistry import ContainerRegistry + +class CannotSetNextStackError(Exception): + pass + +class GlobalStack(ContainerStack): + def __init__(self, container_id, *args, **kwargs): + super().__init__(container_id, *args, **kwargs) + +global_stack_mime = MimeType( + name = "application/x-cura-globalstack", + comment = "Cura Global Stack", + suffixes = [ "global.cfg" ] +) + +MimeTypeDatabase.addMimeType(global_stack_mime) +ContainerRegistry.addContainerTypeByName(GlobalStack, "global_stack", global_stack_mime.name)