printrun-src/plater.py

changeset 45
c82943fb205f
parent 15
0bbb006204fc
--- a/printrun-src/plater.py	Tue Jan 19 20:44:16 2021 +0100
+++ b/printrun-src/plater.py	Tue Jan 19 20:45:09 2021 +0100
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 # This file is part of the Printrun suite.
 #
@@ -15,6 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with Printrun.  If not, see <http://www.gnu.org/licenses/>.
 
+import os
 import sys
 import wx
 import getopt
@@ -25,25 +26,28 @@
 
     from printrun.printcore import __version__ as printcore_version
 
+    os.environ['GDK_BACKEND'] = 'x11'
+
     usage = "Usage:\n"+\
             "  plater [OPTION]\n"+\
             "  plater FILES\n\n"+\
             "Options:\n"+\
             "  -V, --version\t\t\tPrint program's version number and exit\n"+\
-            "  -h, --help\t\t\tPrint this help message and exit\n"
+            "  -h, --help\t\t\tPrint this help message and exit\n" \
+            "  --no-gl\t\t\tUse 2D implementation, that seems unusable"
 
     try:
-        opts, args = getopt.getopt(sys.argv[1:], "hV", ["help", "version"])
-    except getopt.GetoptError, err:
-        print str(err)
-        print usage
+        opts, args = getopt.getopt(sys.argv[1:], "hV", ["help", "version", 'no-gl'])
+    except getopt.GetoptError as err:
+        print(str(err))
+        print(usage)
         sys.exit(2)
     for o, a in opts:
         if o in ('-V','--version'):
-            print "printrun "+printcore_version
+            print("printrun "+printcore_version)
             sys.exit(0)
         elif o in ('-h', '--help'):
-            print usage
+            print(usage)
             sys.exit(0)
 
     app = wx.App(False)

mercurial