menu: allow empty command gcode if action is present

Signed-off-by: Janar Sööt <janar.soot@gmail.com>
This commit is contained in:
Janar Sööt 2018-12-20 21:37:31 +02:00 committed by Kevin O'Connor
parent 0cbe851777
commit 3a4a1d678e
1 changed files with 3 additions and 1 deletions

View File

@ -474,8 +474,10 @@ class MenuItem(MenuElement):
class MenuCommand(MenuItem):
def __init__(self, manager, config, namespace=''):
super(MenuCommand, self).__init__(manager, config, namespace)
self._gcode = config.get('gcode')
self._gcode = config.get('gcode', '')
self._action = config.get('action', None)
if self._action is None and not self._gcode:
raise error("Missing or empty 'gcode' option")
def is_readonly(self):
return False