All pastes #807734 Raw Edit

Stuff

public text v1 · immutable
#807734 ·published 2007-12-06 23:25 UTC
rendered paste body
--- face.py.orig	2007-12-06 17:18:30.000000000 -0600
+++ face.py	2007-12-06 17:25:09.000000000 -0600
@@ -21,6 +21,9 @@
 from SimpleDialog import *
 from ConfigParser import *
 import tkMessageBox
+import os
+
+IN_AXIS = os.environ.has_key("AXIS_PROGRESS_BAR")
 
 class Application(Frame):
     def __init__(self, master=None):
@@ -134,9 +137,16 @@
         self.WriteButton = Button(self, text='Write to File',command=self.WriteToFile)
         self.WriteButton.grid(row=7, column=2)
         
-        self.quitButton = Button(self, text='Quit', command=self.quit)
+        if IN_AXIS:
+            self.quitButton = Button(self, text='Write to AXIS and Quit', command=self.WriteToAxis)
+        else:
+            self.quitButton = Button(self, text='Quit', command=self.quit)
         self.quitButton.grid(row=7, column=3)
 
+    def WriteToAxis(self):
+        sys.stdout.write(self.g_code.get(0.0, END))
+        self.quit()
+
     def GenCode(self):
         """ Generate the G-Code for facing a part 
         assume that the part is at X0 to X+, Y0 to Y-"""