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