mirror of https://github.com/Desuuuu/klipper.git
virtual_sdcard: Allow spaces in file path for M23
Also makes M23 work normally with rename_existing. Signed-off-by: Justin Schuh <code@justinschuh.com>
This commit is contained in:
parent
b4b19b8fc1
commit
1390b4d600
|
@ -158,13 +158,7 @@ class VirtualSD:
|
||||||
if self.work_timer is not None:
|
if self.work_timer is not None:
|
||||||
raise gcmd.error("SD busy")
|
raise gcmd.error("SD busy")
|
||||||
self._reset_file()
|
self._reset_file()
|
||||||
try:
|
filename = gcmd.get_raw_command_parameters().strip()
|
||||||
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")
|
|
||||||
if filename.startswith('/'):
|
if filename.startswith('/'):
|
||||||
filename = filename[1:]
|
filename = filename[1:]
|
||||||
self._load_file(gcmd, filename)
|
self._load_file(gcmd, filename)
|
||||||
|
|
Loading…
Reference in New Issue