mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-21 21:58:01 -06:00
Version upgrade for jobname_prefix -> job_name_template
CURA-5479
This commit is contained in:
parent
06284b6a73
commit
fe7e89835b
1 changed files with 9 additions and 0 deletions
|
@ -4,6 +4,8 @@
|
|||
import configparser
|
||||
from typing import Tuple, List, Dict
|
||||
import io
|
||||
|
||||
from UM.Util import parseBool
|
||||
from UM.VersionUpgrade import VersionUpgrade
|
||||
|
||||
|
||||
|
@ -28,6 +30,13 @@ class VersionUpgrade462to47(VersionUpgrade):
|
|||
# Update version number.
|
||||
parser["metadata"]["setting_version"] = "15"
|
||||
|
||||
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()]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue