Remove an if-else block that assumes no ExtruderStack

There is always an ExtruderStack, so the else-block will never be
executed.
This commit is contained in:
Lipu Fei 2018-09-27 11:43:18 +02:00
parent 3c8368827b
commit b1198ee1b8

View file

@ -40,13 +40,9 @@ class CustomSettingFunctions:
global_stack = machine_manager.activeMachine
extruder_stack = global_stack.extruders[str(extruder_position)]
if extruder_stack:
value = extruder_stack.getRawProperty(property_key, "value", context = context)
if isinstance(value, SettingFunction):
value = value(extruder_stack, context = context)
else:
# Just a value from global.
value = global_stack.getProperty(property_key, "value", context = context)
value = extruder_stack.getRawProperty(property_key, "value", context = context)
if isinstance(value, SettingFunction):
value = value(extruder_stack, context = context)
return value