<commit_before># Copyright (c) 2015 <NAME>.V.
# Uranium is released under the terms of the AGPLv3 or higher.

from UM.Scene.SceneNodeDecorator import SceneNodeDecorator
from UM.Signal import Signal, SignalEmitter
from UM.Application import Application

from copy import deepcopy

##  A decorator that can be used to override individual setting values.
class SettingOverrideDecorator(SceneNodeDecorator, SignalEmitter):
    def __init__(self):
        super().__init__()

        self._settings = {}
        self._setting_values = {}

        self._temp_values = {}

    settingAdded = Signal()
    settingRemoved = Signal()
    settingValueChanged = Signal()

    def getAllSettings(self):
        return self._settings

    def getAllSettingValues(self):
        self._temp_values = {}

        settings = Application.getInstance().getMachineManager().getActiveMachineInstance().getMachineDefinition().getAllSettings(include_machine = False)
        for setting in settings:
            key = setting.getKey()

            if key in self._setting_values:
                self._temp_values[key] = setting.parseValue(self._setting_values[key])
                continue
<commit_msg>Get allsettingsvalues now only returns changed values<commit_after># Copyright (c) 2015 <NAME>.
# Uranium is released under the terms of the AGPLv3 or higher.

from UM.Scene.SceneNodeDecorator import SceneNodeDecorator
from UM.Signal import Signal, SignalEmitter
from UM.Application import Application

from copy import deepcopy

##  A decorator that can be used to override individual setting values.
class SettingOverrideDecorator(SceneNodeDecorator, SignalEmitter):
    def __init__(self):
        super().__init__()

        self._settings = {}
        self._setting_values = {}

        self._temp_values = {}

    settingAdded = Signal()
    settingRemoved = Signal()
    settingValueChanged = Signal()

    def getAllSettings(self):
        return self._settings

    def getAllSettingValues(self):
        self._temp_values = {}
        instance = Application.getInstance().getMachineManager().getActiveMachineInstance()

        for key in self._settings:
            setting = instance.getMachineDefinition().getSetting(key)

            if key in self._setting_values:
                self._temp_values[key] = setting.parseValue(self._setting_values[key])
                continue

{'fraction_non_alphanumeric': 0.08094435075885328, 'fraction_numerical': 0.0042158516020236085, 'mean_word_length': 3.2375, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6873671', 'n_tokens_mistral': 642, 'n_tokens_neox': 600, 'n_words': 169}