wscript (1240B)
1 #! /usr/bin/env python 2 # encoding: utf-8# 3 # Federico Pellegrin, 2016 (fedepell) 4 5 """ 6 Python QT5 helper tools example: 7 converts QT5 Designer tools files (UI and QRC) into python files with 8 the appropriate tools (pyqt5 and pyside2 searched) and manages their 9 python compilation and installation using standard python waf Tool 10 11 """ 12 def options(opt): 13 # Load also python to demonstrate mixed calls 14 opt.load('python pyqt5') 15 16 def configure(conf): 17 # Recent UIC/RCC versions require explicit python generator selection 18 conf.env.QT_PYUIC_FLAGS = ['-g', 'python'] 19 conf.env.QT_PYRCC_FLAGS = ['-g', 'python'] 20 # Load also python to demonstrate mixed calls 21 conf.load('python pyqt5') 22 conf.check_python_version((2,7,4)) 23 24 def build(bld): 25 # Demonstrates mixed usage of py and pyqt5 module, and tests also install_path and install_from 26 # (since generated files go into build it has to be reset inside the pyqt5 tool) 27 bld(features="py pyqt5", source="src/sample.py src/firstgui.ui", install_path="${PREFIX}/play/", install_from="src/") 28 29 # Simple usage on a resource file. If a file referenced inside the resource changes it will be rebuilt 30 # as the qrc XML is parsed and dependencies are calculated 31 bld(features="pyqt5", source="sampleRes.qrc") 32