Check PyQt version and fix icon for lrfviewer

This commit is contained in:
Kovid Goyal 2007-10-08 20:06:49 +00:00
parent 4d782cce87
commit 9c21a23ce8

View File

@ -202,6 +202,13 @@ def post_install():
except:
print >>sys.stderr, 'You do not have the Portland Desktop Utilities installed, skipping installation of desktop integration'
try:
from PyQt4 import Qt
if Qt.PYQT_VERSION < int('0x40301', 16):
print 'WARNING: You need PyQt >= 4.3.1 for the GUI to work. You have', Qt.PYQT_VERSION_STR
except ImportError:
print 'WARNING: You do not have PyQt4 installed. The GUI will not work.'
VIEWER = '''\
@ -264,7 +271,7 @@ def setup_desktop_integration():
check_call('xdg-icon-resource install --context mimetypes --size 128 libprs500-lrf.png application-lrf', shell=True)
check_call('xdg-icon-resource install --context mimetypes --size 128 libprs500-lrf.png text-lrs', shell=True)
check_call('xdg-icon-resource install --size 128 libprs500-gui.png libprs500-gui', shell=True)
check_call('xdg-icon-resource install --size 128 libprs500-gui.png libprs500-gui', shell=True)
check_call('xdg-icon-resource install --size 128 libprs500-viewer.png libprs500-viewer', shell=True)
f = open('libprs500-lrfviewer.desktop', 'wb')
f.write(VIEWER)
f.close()