Skip to content

Commit

Permalink
Additional settings: Save/load functionality requires all lower-case.
Browse files Browse the repository at this point in the history
When saving to cfg (which is in the zipped 3mf file), the variables are forced to lower case. If a plugin-ID contains capital letters, it would not be able to match the settings it saved and the setting loaded otherwise.

part of CURA-10722
  • Loading branch information
rburema committed Jul 26, 2023
1 parent bf710f5 commit 211279a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions UM/Settings/AdditionalSettingDefinitionAppender.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ def prependIdToSettings(tag_type: str, tag_id: str, tag_version: str, settings:
For each key that is renamed, this results in a mapping <key> -> _<provider_type>__<id*>__<version>__<key>
where '<id*>' is the version of the provider, but converted from using points to using underscores.
Example: 'tapdance_factor' might become '_PLUGIN__DancingPrinter__1_2_99__tapdance_factor'
Example: 'tapdance_factor' might become '_plugin__dancingprinter__1_2_99__tapdance_factor'
Also note that all the tag_... parameters will be forced to lower-case.
:param tag_type: Type of the additional settings appender, for example; "PLUGIN".
:param tag_id: ID of the provider. Should be unique.
Expand All @@ -30,7 +31,9 @@ def prependIdToSettings(tag_type: str, tag_id: str, tag_version: str, settings:
:returns: Remapped settings, where each settings-name is properly tagged/'namespaced'.
"""
tag_version = tag_version.replace(".", "_")
tag_type = tag_type.lower()
tag_id = tag_id.lower()
tag_version = tag_version.lower().replace(".", "_")

# First get the mapping, so that both the 'headings' and formula's can be renamed at the same time later.
def _getMapping(values: Dict[str, Any]) -> Dict[str, str]:
Expand Down

0 comments on commit 211279a

Please sign in to comment.