chiark / gitweb /
14dc53b1e5cb6ef968a08bb2228d077c569bea73
[cura.git] / Cura / cura.py
1 #!/usr/bin/python
2 """
3 This page is in the table of contents.
4 ==Overview==
5 ===Introduction===
6 Cura is a GPL tool chain to forge a gcode skein for a model. Based on Skeinforge.
7
8 The slicing code is the same as Skeinforge. But the UI has been revamped to be... sane.
9
10 """
11
12 from __future__ import absolute_import
13 import __init__
14
15 import sys
16 import platform
17 from optparse import OptionParser
18
19 from util import profile
20 from util import sliceRun
21
22 __author__ = 'Daid'
23 __credits__ = """
24 Enrique Perez (perez_enrique@yahoo.com)
25 Adrian Bowyer <http://forums.reprap.org/profile.php?12,13>
26 Brendan Erwin <http://forums.reprap.org/profile.php?12,217>
27 Greenarrow <http://forums.reprap.org/profile.php?12,81>
28 Ian England <http://forums.reprap.org/profile.php?12,192>
29 John Gilmore <http://forums.reprap.org/profile.php?12,364>
30 Jonwise <http://forums.reprap.org/profile.php?12,716>
31 Kyle Corbitt <http://forums.reprap.org/profile.php?12,90>
32 Michael Duffin <http://forums.reprap.org/profile.php?12,930>
33 Marius Kintel <http://reprap.soup.io/>
34 Nophead <http://www.blogger.com/profile/12801535866788103677>
35 PJR <http://forums.reprap.org/profile.php?12,757>
36 Reece.Arnott <http://forums.reprap.org/profile.php?12,152>
37 Wade <http://forums.reprap.org/profile.php?12,489>
38 Xsainnz <http://forums.reprap.org/profile.php?12,563>
39 Zach Hoeken <http://blog.zachhoeken.com/>
40
41 Organizations:
42 Art of Illusion <http://www.artofillusion.org/>"""
43
44 __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
45
46 def main():
47         parser = OptionParser(usage="usage: %prog [options] <filename>.stl")
48         parser.add_option("-p", "--profile", action="store", type="string", dest="profile", help="Use these profile settings instead of loading current_profile.ini")
49         parser.add_option("-P", "--project", action="store_true", dest="openprojectplanner", help="Open the project planner")
50         parser.add_option("-r", "--print", action="store", type="string", dest="printfile", help="Open the printing interface, instead of the normal cura interface.")
51         (options, args) = parser.parse_args()
52         if options.profile != None:
53                 profile.loadGlobalProfileFromString(options.profile)
54         if options.openprojectplanner != None:
55                 from gui import projectPlanner
56                 projectPlanner.main()
57                 return
58         if options.printfile != None:
59                 from gui import printWindow
60                 printWindow.startPrintInterface(options.printfile)
61                 return
62
63         if len( args ) > 0:
64                 sliceRun.runSlice(args)
65         else:
66                 from gui import mainWindow
67                 mainWindow.main()
68
69 if __name__ == '__main__':
70         main()
71