mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-09-13 07:23:13 +08:00
Version upgrade for jobname_prefix -> job_name_template
CURA-5479
This commit is contained in:
parent
06284b6a73
commit
fe7e89835b
@ -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…
x
Reference in New Issue
Block a user