chiark / gitweb /
show printing z position in gcode view via layer range and slider
[cura.git] / Cura / cura.py
index a475705b28b610cfd2eedf6f5b8a74c0a6fc1f42..c631a02ff3255bb598daab70bd3574c12ad190ce 100644 (file)
@@ -11,8 +11,6 @@ __copyright__ = "Copyright (C) 2013 David Braam - Released under terms of the AG
 
 from optparse import OptionParser
 
-from Cura.util import resources
-resources.setupLocalization()  # it's important to set up localization at very beginning to install _
 from Cura.util import profile
 
 def main():
@@ -32,7 +30,7 @@ def main():
 
        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:
@@ -47,15 +45,17 @@ def main():
                from Cura.util import meshLoader
                import shutil
 
-               def commandlineProgessCallback(progress, ready):
+               def commandlineProgressCallback(progress, ready):
                        if progress >= 0 and not ready:
                                print 'Preparing: %d%%' % (progress * 100)
                scene = objectScene.Scene()
-               slicer = sliceEngine.Slicer(commandlineProgessCallback)
+               scene.updateMachineDimensions()
+               slicer = sliceEngine.Slicer(commandlineProgressCallback)
                for m in meshLoader.loadMeshes(args[0]):
                        scene.add(m)
                slicer.runSlicer(scene)
                slicer.wait()
+               profile.replaceGCodeTagsFromSlicer(slicer.getGCodeFilename(), slicer)
 
                if options.output:
                        shutil.copyfile(slicer.getGCodeFilename(), options.output)