chiark / gitweb /
Add a url to materials and show a hyperlink
[cura.git] / Cura / cura.py
index 32b82158dc588bc825d98f2ea7ccf0311a90f1a3..27bac0d3902f1d2571c0029ffc95adca9288a52d 100644 (file)
@@ -19,8 +19,6 @@ def main():
        parser = OptionParser(usage="usage: %prog [options] <filename>.stl")
        parser.add_option("-i", "--ini", action="store", type="string", dest="profileini",
                help="Load settings from a profile ini file")
-       parser.add_option("-r", "--print", action="store", type="string", dest="printfile",
-               help="Open the printing interface, instead of the normal cura interface.")
        parser.add_option("-p", "--profile", action="store", type="string", dest="profile",
                help="Internal option, do not use!")
        parser.add_option("-s", "--slice", action="store_true", dest="slice",
@@ -34,7 +32,8 @@ def main():
 
        if options.serialCommunication:
                from Cura import serialCommunication
-               serialCommunication.startMonitor(options.serialCommunication)
+               port, baud = options.serialCommunication.split(':')
+               serialCommunication.startMonitor(port, baud)
                return
 
        print "load preferences from " + profile.getPreferencePath()
@@ -47,10 +46,7 @@ def main():
        else:
                profile.loadProfile(profile.getDefaultProfilePath(), True)
 
-       if options.printfile is not None:
-               from Cura.gui import printWindow
-               printWindow.startPrintInterface(options.printfile)
-       elif options.slice is not None:
+       if options.slice is not None:
                from Cura.util import sliceEngine
                from Cura.util import objectScene
                from Cura.util import meshLoader
@@ -69,9 +65,14 @@ def main():
                engine.wait()
 
                if not options.output:
-                       options.output = args[0] + '.gcode'
+                       options.output = args[0] + profile.getGCodeExtension()
                with open(options.output, "wb") as f:
-                       f.write(engine.getResult().getGCode())
+                       gcode = engine.getResult().getGCode()
+                       while True:
+                               data = gcode.read()
+                               if len(data) == 0:
+                                       break
+                               f.write(data)
                print 'GCode file saved : %s' % options.output
 
                engine.cleanup()