diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2021-07-23 11:09:46 +0000 |
---|---|---|
committer | KevinOConnor <kevin@koconnor.net> | 2021-07-26 22:34:43 -0400 |
commit | 7e88f9220c641dd1e7e5b748381bd7ac758bc8d2 (patch) | |
tree | 4ddf8569f40e25bb2b801df8a76f7803e19ce21d /klippy/extras/display | |
parent | c8405fe3dbe536bab89b3f9e5c24d79dd400121b (diff) | |
download | kutter-7e88f9220c641dd1e7e5b748381bd7ac758bc8d2.tar.gz kutter-7e88f9220c641dd1e7e5b748381bd7ac758bc8d2.tar.xz kutter-7e88f9220c641dd1e7e5b748381bd7ac758bc8d2.zip |
menu: fix crash when opening SDCard menu while printing
This fixes the bug introduced by https://github.com/KevinOConnor/klipper/commit/f1091a484bfbf2cc5676e3a6fcd595172f123f67.
The problem is that condition was returning string which
could not be converted to boolean. We solve that by showing
`Start Printing` when `is_active`.
```
ERROR:root:Unhandled exception during run
Traceback (most recent call last):
...
File "/opt/klipper/klippy/extras/display/menu.py", line 117, in eval_enable
return bool(ast.literal_eval(self._enable_tpl.render(context)))
File "/usr/lib/python2.7/ast.py", line 49, in literal_eval
node_or_string = parse(node_or_string, mode='eval')
File "/usr/lib/python2.7/ast.py", line 37, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File "<unknown>", line 1
/opt/octoprint/uploads/wait_print.gcode
```
Signed-off-by: Kamil Trzcinski <ayufan@ayufan.eu>
Diffstat (limited to 'klippy/extras/display')
-rw-r--r-- | klippy/extras/display/menu.cfg | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/klippy/extras/display/menu.cfg b/klippy/extras/display/menu.cfg index 213aea02..d3d99d68 100644 --- a/klippy/extras/display/menu.cfg +++ b/klippy/extras/display/menu.cfg @@ -165,7 +165,7 @@ name: SD Card [menu __main __sdcard __start] type: command -enable: {('virtual_sdcard' in printer) and printer.virtual_sdcard.file_path} +enable: {('virtual_sdcard' in printer) and printer.virtual_sdcard.file_path and not printer.virtual_sdcard.is_active} name: Start printing gcode: M24 |