From 0f30c8ba2b47ccdc59e87c9ccf34378d02e035f6 Mon Sep 17 00:00:00 2001 From: vocx-fc Date: Fri, 19 Jun 2020 16:11:11 -0500 Subject: [PATCH] Draft: migrate DraftText type to Text --- src/Mod/Draft/draftobjects/draft_annotation.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Mod/Draft/draftobjects/draft_annotation.py b/src/Mod/Draft/draftobjects/draft_annotation.py index c8e55b7f06..e243559331 100644 --- a/src/Mod/Draft/draftobjects/draft_annotation.py +++ b/src/Mod/Draft/draftobjects/draft_annotation.py @@ -125,8 +125,18 @@ class DraftAnnotation(object): """ if state: if isinstance(state, dict) and ("Type" in state): + # During the migration of the classes + # the 'DraftText' type was changed to 'Text' type + if state["Type"] == "DraftText": + state["Type"] = "Text" + _info = "migrate 'DraftText' type to 'Text'" + _wrn("v0.19, " + _tr(_info)) self.Type = state["Type"] else: + if state == "DraftText": + state = "Text" + _info = "migrate 'DraftText' type to 'Text'" + _wrn("v0.19, " + _tr(_info)) self.Type = state def execute(self, obj):