mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-08-05 21:14:05 -06:00
gcode: Rename respond() to respond_raw()
Rename the method to make it more clear that it is a low-level call that should be rarely used. Also, change gcode_button.py, hall_filament_width_sensor.py, and tsl1401cl_filament_width_sensor.py to use respond_info() instead of respond_raw(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
61524542d2
commit
64031ab3d7
8 changed files with 31 additions and 31 deletions
|
@ -72,13 +72,13 @@ class VirtualSD:
|
|||
def cmd_M20(self, params):
|
||||
# List SD card
|
||||
files = self.get_file_list()
|
||||
self.gcode.respond("Begin file list")
|
||||
self.gcode.respond_raw("Begin file list")
|
||||
for fname, fsize in files:
|
||||
self.gcode.respond("%s %d" % (fname, fsize))
|
||||
self.gcode.respond("End file list")
|
||||
self.gcode.respond_raw("%s %d" % (fname, fsize))
|
||||
self.gcode.respond_raw("End file list")
|
||||
def cmd_M21(self, params):
|
||||
# Initialize SD card
|
||||
self.gcode.respond("SD card ok")
|
||||
self.gcode.respond_raw("SD card ok")
|
||||
def cmd_M23(self, params):
|
||||
# Select SD file
|
||||
if self.work_timer is not None:
|
||||
|
@ -108,8 +108,8 @@ class VirtualSD:
|
|||
except:
|
||||
logging.exception("virtual_sdcard file open")
|
||||
raise self.gcode.error("Unable to open file")
|
||||
self.gcode.respond("File opened:%s Size:%d" % (filename, fsize))
|
||||
self.gcode.respond("File selected")
|
||||
self.gcode.respond_raw("File opened:%s Size:%d" % (filename, fsize))
|
||||
self.gcode.respond_raw("File selected")
|
||||
self.current_file = f
|
||||
self.file_position = 0
|
||||
self.file_size = fsize
|
||||
|
@ -132,9 +132,9 @@ class VirtualSD:
|
|||
def cmd_M27(self, params):
|
||||
# Report SD print status
|
||||
if self.current_file is None:
|
||||
self.gcode.respond("Not SD printing.")
|
||||
self.gcode.respond_raw("Not SD printing.")
|
||||
return
|
||||
self.gcode.respond("SD printing byte %d/%d" % (
|
||||
self.gcode.respond_raw("SD printing byte %d/%d" % (
|
||||
self.file_position, self.file_size))
|
||||
# Background work timer
|
||||
def work_handler(self, eventtime):
|
||||
|
@ -162,7 +162,7 @@ class VirtualSD:
|
|||
self.current_file.close()
|
||||
self.current_file = None
|
||||
logging.info("Finished SD card print")
|
||||
self.gcode.respond("Done printing file")
|
||||
self.gcode.respond_raw("Done printing file")
|
||||
break
|
||||
lines = data.split('\n')
|
||||
lines[0] = partial_input + lines[0]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue