File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import sys
2+ import traceback
23
34# A python interface for LinuxCNC tool database usage
45
@@ -30,6 +31,7 @@ def currentline():
3031
3132def nak_reply (msg ):
3233 theline = currentline ()
34+ if msg != "empty_line" : sys .stderr .write (traceback .format_exc ()+ "\n " )
3335 sys .stdout .write ("NAK %s <%s>\n " % (msg ,theline ))
3436 sys .stdout .flush ()
3537
@@ -56,7 +58,7 @@ def get_cmd(cmd,params):
5658 for tno in tools :
5759 try : msg = get_tool (tno )
5860 except Exception as e :
59- nak_reply ( "get_cmd():%s" % str (e ))
61+ nak_reply ( "get_cmd():Exception: %s" % str (e ))
6062 return
6163 try : do_reply (msg )
6264 except :
@@ -88,7 +90,7 @@ def put_cmds(cmd,params):
8890 elif cmd == "l" : load_spindle ( toolno ,toolline )
8991 elif cmd == "u" : unload_spindle (toolno ,toolline )
9092 except Exception as e :
91- nak_reply ( "cmd=%s: %s" % (cmd ,str (e )))
93+ nak_reply ( "cmd=%s: Exception: %s" % (cmd ,str (e )))
9294 return
9395 do_reply ("FINI (update recvd) %s" % params )
9496
@@ -152,7 +154,7 @@ def tooldb_loop():
152154 line = sys .stdin .readline ().strip ()
153155
154156 saveline (line )
155- if (line == "" ): nak_reply ("empty line " )
157+ if (line == "" ): nak_reply ("empty_line " )
156158 else : do_cmd (line )
157159 except BrokenPipeError : sys .stdout .close ()
158160 except Exception as e :
You can’t perform that action at this time.
0 commit comments