Example #1
0
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("-P", "--project", action="store_true", dest="openprojectplanner", help="Open the project planner")
	parser.add_option("-F", "--flat", action="store_true", dest="openflatslicer", help="Open the 2D SVG slicer (unfinished)")
	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", help="Slice the given files instead of opening them in Cura")
	(options, args) = parser.parse_args()
	if options.profile != None:
		profile.loadGlobalProfileFromString(options.profile)
	if options.profileini != None:
		profile.loadGlobalProfile(options.profileini)
	if options.openprojectplanner != None:
		from gui import projectPlanner
		projectPlanner.main()
		return
	if options.openflatslicer != None:
		from gui import flatSlicerWindow
		flatSlicerWindow.main()
		return
	if options.printfile != None:
		from gui import printWindow
		printWindow.startPrintInterface(options.printfile)
		return

	if options.slice != None:
		from util import sliceRun
		sliceRun.runSlice(args)
	else:
		if len(args) > 0:
			profile.putPreference('lastFile', ';'.join(args))
		from gui import splashScreen
		splashScreen.showSplash(mainWindowRunCallback)
Example #2
0
File: cura.py Project: danilke/Cura
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("-P", "--project", action="store_true", dest="openprojectplanner", help="Open the project planner")
	parser.add_option("-F", "--flat", action="store_true", dest="openflatslicer", help="Open the 2D SVG slicer")
	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!")
	(options, args) = parser.parse_args()
	if options.profile != None:
		profile.loadGlobalProfileFromString(options.profile)
	if options.profileini != None:
		profile.loadGlobalProfile(options.profileini)
	if options.openprojectplanner != None:
		from gui import projectPlanner
		projectPlanner.main()
		return
	if options.openflatslicer != None:
		from gui import flatSlicerWindow
		flatSlicerWindow.main()
		return
	if options.printfile != None:
		from gui import printWindow
		printWindow.startPrintInterface(options.printfile)
		return

	if len( args ) > 0:
		sliceRun.runSlice(args)
	else:
		from gui import mainWindow
		mainWindow.main()