mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
Minor refactoring for XMLMaterial upgrade
CURA-3756
This commit is contained in:
parent
c43a71084c
commit
7089460861
2 changed files with 4 additions and 4 deletions
|
@ -6,7 +6,7 @@ import xml.etree.ElementTree as ET
|
||||||
from UM.VersionUpgrade import VersionUpgrade
|
from UM.VersionUpgrade import VersionUpgrade
|
||||||
|
|
||||||
|
|
||||||
class Upgrader(VersionUpgrade):
|
class XmlMaterialUpgrader(VersionUpgrade):
|
||||||
def getXmlVersion(self, serialized):
|
def getXmlVersion(self, serialized):
|
||||||
data = ET.fromstring(serialized)
|
data = ET.fromstring(serialized)
|
||||||
|
|
|
@ -2,14 +2,14 @@
|
||||||
# Cura is released under the terms of the AGPLv3 or higher.
|
# Cura is released under the terms of the AGPLv3 or higher.
|
||||||
|
|
||||||
from . import XmlMaterialProfile
|
from . import XmlMaterialProfile
|
||||||
from . import Upgrader
|
from . import XmlMaterialUpgrader
|
||||||
|
|
||||||
from UM.MimeTypeDatabase import MimeType, MimeTypeDatabase
|
from UM.MimeTypeDatabase import MimeType, MimeTypeDatabase
|
||||||
from UM.i18n import i18nCatalog
|
from UM.i18n import i18nCatalog
|
||||||
|
|
||||||
|
|
||||||
catalog = i18nCatalog("cura")
|
catalog = i18nCatalog("cura")
|
||||||
upgrader = Upgrader.Upgrader()
|
upgrader = XmlMaterialUpgrader.XmlMaterialUpgrader()
|
||||||
|
|
||||||
|
|
||||||
def getMetaData():
|
def getMetaData():
|
||||||
|
@ -49,7 +49,7 @@ def register(app):
|
||||||
# add upgrade version
|
# add upgrade version
|
||||||
from cura.CuraApplication import CuraApplication
|
from cura.CuraApplication import CuraApplication
|
||||||
from UM.VersionUpgradeManager import VersionUpgradeManager
|
from UM.VersionUpgradeManager import VersionUpgradeManager
|
||||||
VersionUpgradeManager.getInstance().setCurrentVersion(
|
VersionUpgradeManager.getInstance().registerCurrentVersion(
|
||||||
("materials", XmlMaterialProfile.XmlMaterialProfile.Version * 1000000 + CuraApplication.SettingVersion),
|
("materials", XmlMaterialProfile.XmlMaterialProfile.Version * 1000000 + CuraApplication.SettingVersion),
|
||||||
(CuraApplication.ResourceTypes.MaterialInstanceContainer, "application/x-uranium-instancecontainer")
|
(CuraApplication.ResourceTypes.MaterialInstanceContainer, "application/x-uranium-instancecontainer")
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue