From 1390b4d600c8339092582ed2cb3fe4b4bd1edb48 Mon Sep 17 00:00:00 2001 From: Justin Schuh Date: Tue, 1 Mar 2022 15:58:59 -0800 Subject: [PATCH] virtual_sdcard: Allow spaces in file path for M23 Also makes M23 work normally with rename_existing. Signed-off-by: Justin Schuh --- klippy/extras/virtual_sdcard.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/klippy/extras/virtual_sdcard.py b/klippy/extras/virtual_sdcard.py index 265a13f9..397c6513 100644 --- a/klippy/extras/virtual_sdcard.py +++ b/klippy/extras/virtual_sdcard.py @@ -158,13 +158,7 @@ class VirtualSD: if self.work_timer is not None: raise gcmd.error("SD busy") self._reset_file() - try: - orig = gcmd.get_commandline() - filename = orig[orig.find("M23") + 4:].split()[0].strip() - if '*' in filename: - filename = filename[:filename.find('*')].strip() - except: - raise gcmd.error("Unable to extract filename") + filename = gcmd.get_raw_command_parameters().strip() if filename.startswith('/'): filename = filename[1:] self._load_file(gcmd, filename)