Prevent circular import

When this is imported during the __init__, it'll long have been imported elsewhere and won't need to import it again but still guarantees that it is actually imported if no other module does it first.

Contributes to issue CURA-4024.
This commit is contained in:
Ghostkeeper 2017-07-10 16:42:38 +02:00
parent ee52e1b9ea
commit 012d299d98
No known key found for this signature in database
GPG key ID: C5F96EE2BC0F7E75

View file

@ -8,7 +8,6 @@ from typing import Any, Optional
from PyQt5.QtCore import pyqtProperty, pyqtSignal, QObject from PyQt5.QtCore import pyqtProperty, pyqtSignal, QObject
from UM.FlameProfiler import pyqtSlot from UM.FlameProfiler import pyqtSlot
import cura.CuraApplication #To get the setting version.
from UM.Decorators import override from UM.Decorators import override
from UM.Logger import Logger from UM.Logger import Logger
from UM.Settings.ContainerStack import ContainerStack, InvalidContainerStackError from UM.Settings.ContainerStack import ContainerStack, InvalidContainerStackError
@ -48,6 +47,7 @@ class CuraContainerStack(ContainerStack):
self.containersChanged.connect(self._onContainersChanged) self.containersChanged.connect(self._onContainersChanged)
import cura.CuraApplication #Here to prevent circular imports.
self.addMetaDataEntry("setting_version", cura.CuraApplication.CuraApplication.SettingVersion) self.addMetaDataEntry("setting_version", cura.CuraApplication.CuraApplication.SettingVersion)
# This is emitted whenever the containersChanged signal from the ContainerStack base class is emitted. # This is emitted whenever the containersChanged signal from the ContainerStack base class is emitted.