printrun-src/plater.py

Sat, 23 Sep 2017 13:07:51 +0200

author
mdd
date
Sat, 23 Sep 2017 13:07:51 +0200
changeset 35
72c4cbf64211
parent 15
0bbb006204fc
child 45
c82943fb205f
permissions
-rw-r--r--

Final bugfixes, SVG working like a charm now

15
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
1 #!/usr/bin/env python
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
2
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
3 # This file is part of the Printrun suite.
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
4 #
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
5 # Printrun is free software: you can redistribute it and/or modify
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
6 # it under the terms of the GNU General Public License as published by
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
7 # the Free Software Foundation, either version 3 of the License, or
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
8 # (at your option) any later version.
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
9 #
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
10 # Printrun is distributed in the hope that it will be useful,
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
13 # GNU General Public License for more details.
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
14 #
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
15 # You should have received a copy of the GNU General Public License
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
16 # along with Printrun. If not, see <http://www.gnu.org/licenses/>.
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
17
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
18 import sys
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
19 import wx
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
20 import getopt
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
21
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
22 from printrun.stlplater import StlPlater
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
23
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
24 if __name__ == '__main__':
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
25
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
26 from printrun.printcore import __version__ as printcore_version
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
27
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
28 usage = "Usage:\n"+\
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
29 " plater [OPTION]\n"+\
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
30 " plater FILES\n\n"+\
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
31 "Options:\n"+\
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
32 " -V, --version\t\t\tPrint program's version number and exit\n"+\
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
33 " -h, --help\t\t\tPrint this help message and exit\n"
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
34
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
35 try:
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
36 opts, args = getopt.getopt(sys.argv[1:], "hV", ["help", "version"])
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
37 except getopt.GetoptError, err:
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
38 print str(err)
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
39 print usage
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
40 sys.exit(2)
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
41 for o, a in opts:
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
42 if o in ('-V','--version'):
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
43 print "printrun "+printcore_version
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
44 sys.exit(0)
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
45 elif o in ('-h', '--help'):
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
46 print usage
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
47 sys.exit(0)
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
48
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
49 app = wx.App(False)
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
50 main = StlPlater(filenames = sys.argv[1:])
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
51 main.Show()
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
52 app.MainLoop()

mercurial