mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-16 06:35:55 +08:00
Added getters for required & supported actions
CURA-1385
This commit is contained in:
parent
958918e033
commit
5a1af3b1ea
@ -58,6 +58,24 @@ class MachineActionManager:
|
|||||||
# Todo: define specific Exception types (instead of general type)
|
# Todo: define specific Exception types (instead of general type)
|
||||||
raise Exception("MachineAction with key %s was already added. Actions must have unique keys.", action.getKey())
|
raise Exception("MachineAction with key %s was already added. Actions must have unique keys.", action.getKey())
|
||||||
|
|
||||||
|
## Get all actions supported by given machine
|
||||||
|
# \param machine The machine you want the supported actions of
|
||||||
|
# \returns set of supported actions.
|
||||||
|
def getSupportedActions(self, machine):
|
||||||
|
if machine in self._supported_actions:
|
||||||
|
return self._supported_actions[machine]
|
||||||
|
else:
|
||||||
|
return set()
|
||||||
|
|
||||||
|
## Get all actions required by given machine
|
||||||
|
# \param machine The machine you want the required actions of
|
||||||
|
# \returns set of required actions.
|
||||||
|
def getRequiredActions(self, machine):
|
||||||
|
if machine in self._required_actions:
|
||||||
|
return self._required_actions[machine]
|
||||||
|
else:
|
||||||
|
return set()
|
||||||
|
|
||||||
## Remove Machine action from manager
|
## Remove Machine action from manager
|
||||||
# \param action to remove
|
# \param action to remove
|
||||||
def removeMachineAction(self, action):
|
def removeMachineAction(self, action):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user