chiark / gitweb /
Fix the bug where the M140 for bed temperature is not added in the start code.
[cura.git] / Cura / cura.py
index d93a57f98310b09a1cf4b451bd595d8fa1ae204c..2172a4bfa5959fbbc2891f85f3f927dfff3a6310 100644 (file)
@@ -23,11 +23,14 @@ def main():
                help="Internal option, do not use!")
        parser.add_option("-s", "--slice", action="store_true", dest="slice",
                help="Slice the given files instead of opening them in Cura")
+       parser.add_option("-o", "--output", action="store", type="string", dest="output",
+               help="path to write sliced file to")
+
        (options, args) = parser.parse_args()
 
        profile.loadPreferences(profile.getPreferencePath())
        if options.profile is not None:
-               profile.loadProfileFromString(options.profile)
+               profile.setProfileFromString(options.profile)
        elif options.profileini is not None:
                profile.loadProfile(options.profileini)
        else:
@@ -51,8 +54,14 @@ def main():
                        scene.add(m)
                slicer.runSlicer(scene)
                slicer.wait()
-               shutil.copyfile(slicer.getGCodeFilename(), args[0] + '.gcode')
-               print 'GCode file saved as: %s' % (args[0] + '.gcode')
+
+               if options.output:
+                       shutil.copyfile(slicer.getGCodeFilename(), options.output)
+                       print 'GCode file saved : %s' % options.output
+               else:
+                       shutil.copyfile(slicer.getGCodeFilename(), args[0] + '.gcode')
+                       print 'GCode file saved as: %s' % (args[0] + '.gcode')
+
                slicer.cleanup()
        else:
                from Cura.gui import app