mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-24 23:23:57 -06:00
Save reference to the action instead of key
CURA-1385
This commit is contained in:
parent
633d14d925
commit
978536162c
1 changed files with 4 additions and 3 deletions
|
@ -15,13 +15,14 @@ class MachineActionManager:
|
|||
## Dict of all actions that need to be done when first added by machine reference.
|
||||
self._first_start_actions = {}
|
||||
|
||||
## Add a required action
|
||||
## Add a required action to a machine
|
||||
# Raises an exception when the action is not recognised.
|
||||
def addRequiredAction(self, machine, action_key):
|
||||
if action_key in self._machine_actions:
|
||||
if machine in self._required_actions:
|
||||
self._required_actions[machine].append(action_key)
|
||||
self._required_actions[machine].append(self._machine_actions[action_key])
|
||||
else:
|
||||
self._required_actions[machine] = set(action_key)
|
||||
self._required_actions[machine] = set(self._machine_actions[action_key])
|
||||
else:
|
||||
# Todo: define specific Exception types (instead of general type)
|
||||
raise Exception("Action %s, which is required for %s is not known." % (action_key, machine.getKey()))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue