diff options
author | Konstantinos Karmas <konskarm@gmail.com> | 2020-07-06 11:06:39 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-06 11:06:39 +0300 |
commit | 56d21ee190b68caf094408e6022b0c843208b1c6 (patch) | |
tree | c7d653d994d47243270afa3684b6fd8558fbafc2 /plugins/VersionUpgrade | |
parent | 21e28089a8e7047481eaf06a522102d863e46e2f (diff) | |
parent | fe7e89835ba1b57c9c248535c0bb979aca69dbbe (diff) |
Merge pull request #8026 from Ultimaker/CURA-5479_job_name_template
CURA-5479_job_name_template version upgrade
Diffstat (limited to 'plugins/VersionUpgrade')
-rw-r--r-- | plugins/VersionUpgrade/VersionUpgrade462to47/VersionUpgrade462to47.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/plugins/VersionUpgrade/VersionUpgrade462to47/VersionUpgrade462to47.py b/plugins/VersionUpgrade/VersionUpgrade462to47/VersionUpgrade462to47.py index a167c9917e..ae7e421ab8 100644 --- a/plugins/VersionUpgrade/VersionUpgrade462to47/VersionUpgrade462to47.py +++ b/plugins/VersionUpgrade/VersionUpgrade462to47/VersionUpgrade462to47.py @@ -4,6 +4,8 @@ import configparser from typing import Tuple, List, Dict, Set import io + +from UM.Util import parseBool from UM.VersionUpgrade import VersionUpgrade @@ -42,6 +44,13 @@ class VersionUpgrade462to47(VersionUpgrade): parser["general"]["visible_settings"] = ";".join( set(parser["general"]["visible_settings"].split(";")).difference(_removed_settings)) + if "cura" in parser and "jobname_prefix" in parser["cura"]: + if not parseBool(parser["cura"]["jobname_prefix"]): + parser["cura"]["job_name_template"] = "{project_name}" + del parser["cura"]["jobname_prefix"] + # else: When the jobname_prefix preference is True or not set, + # the default value for job_name_template ("{machine_name_short}_{project_name}") will be used + result = io.StringIO() parser.write(result) return [filename], [result.getvalue()] |