Auto merged
[vuplus_bitbake] / bin / oecommander
1 #!/usr/bin/env python
2 # -*- coding: iso8859-15 -*-
3
4 import sys
5
6 #
7 # module global vars and functions
8 #
9 __author__ = "Michael 'Mickey' Lauer <mickey@vanille.de>"
10 __version__ = "0.0.1"
11
12 def fail( reason ):
13     print "ERROR:", reason
14     sys.exit( -1 )
15
16 #
17 # sanity check Qt and PyQt
18 #
19
20 try:
21     from qt import *
22 except ImportError:
23     fail( "Can't import the qt module. You need to have PyQt (http://riverbankcomputing.co.uk) 3.10 or later installed." )
24     sys.exit( -1 )
25
26 try:
27     PYQT_VERSION_STR
28 except NameError:
29     fail( "Your PyQt (%s) is too old. Please upgrade to PyQt 3.10 or later." % PYQT_VERSION )
30
31 major, minor = PYQT_VERSION_STR.split( '.' )
32 if int(major) < 3 or ( int(major) == 3 and int(minor) < 10 ):
33     fail( "Your PyQt (%s) is too old. Please upgrade to PyQt 3.10 or later." % PYQT_VERSION_STR )
34
35 import sys
36 try:
37     from commander.mainwindow import MainWindow
38 except ImportError:
39     fail( "Can't load the GUI parts. Did you 'qmake commander.pro && make' in $OEDIR/commander/?" )
40 from qt import *
41
42 #------------------------------------------------------------------------#
43 # main
44 #------------------------------------------------------------------------#
45
46 from commander.application import CommanderApplication
47 app = CommanderApplication( sys.argv )
48 app.initialize()
49 app.run()