aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/gcode.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2016-11-20 20:40:31 -0500
committerKevin O'Connor <kevin@koconnor.net>2016-11-30 21:19:43 -0500
commit7e7e607e3f6a3de5e7b833d028b77afa619c8024 (patch)
tree02fd67e516d374fbcc0031d97a75e9008810df92 /klippy/gcode.py
parent4eb21a71ae0da16d001b549216793ac84dc691fd (diff)
downloadkutter-7e7e607e3f6a3de5e7b833d028b77afa619c8024.tar.gz
kutter-7e7e607e3f6a3de5e7b833d028b77afa619c8024.tar.xz
kutter-7e7e607e3f6a3de5e7b833d028b77afa619c8024.zip
klippy: Create the /tmp/printer pseudo tty before opening config file
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/gcode.py')
-rw-r--r--klippy/gcode.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/klippy/gcode.py b/klippy/gcode.py
index e4798159..36c552f4 100644
--- a/klippy/gcode.py
+++ b/klippy/gcode.py
@@ -9,10 +9,10 @@ import homing
# Parse out incoming GCode and find and translate head movements
class GCodeParser:
RETRY_TIME = 0.100
- def __init__(self, printer, fd, inputfile=False):
+ def __init__(self, printer, fd, is_fileinput=False):
self.printer = printer
self.fd = fd
- self.inputfile = inputfile
+ self.is_fileinput = is_fileinput
# Input handling
self.reactor = printer.reactor
self.fd_handle = None
@@ -123,11 +123,11 @@ class GCodeParser:
lines[0] = self.input_commands[0] + lines[0]
self.input_commands = lines
self.process_commands(eventtime)
- if not data and self.inputfile:
+ if not data and self.is_fileinput:
self.finish()
# Response handling
def ack(self, msg=None):
- if not self.need_ack or self.inputfile:
+ if not self.need_ack or self.is_fileinput:
return
if msg:
os.write(self.fd, "ok %s\n" % (msg,))
@@ -136,7 +136,7 @@ class GCodeParser:
self.need_ack = False
def respond(self, msg):
logging.debug(msg)
- if self.inputfile:
+ if self.is_fileinput:
return
os.write(self.fd, msg+"\n")
# Busy handling
@@ -188,7 +188,7 @@ class GCodeParser:
self.gcode.respond(self.gcode.get_temp())
self.last_temp_time = eventtime
return self.cur_heater.check_busy(eventtime)
- if self.inputfile:
+ if self.is_fileinput:
return
self.set_busy(temp_busy_handler_wrapper())
def set_temp(self, heater, params, wait=False):
@@ -249,7 +249,7 @@ class GCodeParser:
if not axes:
axes = [0, 1, 2]
homing_state = homing.Homing(self.toolhead, axes)
- if self.inputfile:
+ if self.is_fileinput:
homing_state.set_no_verify_retract()
self.toolhead.home(homing_state)
def axes_update(homing_state):
@@ -307,7 +307,7 @@ class GCodeParser:
kinpos[0], kinpos[1], kinpos[2]))
def cmd_M119(self, params):
# Get Endstop Status
- if self.inputfile:
+ if self.is_fileinput:
return
print_time = self.toolhead.get_last_move_time()
query_state = homing.QueryEndstops(print_time, self.respond)