wscript (1086B)
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 # Load also python to demonstrate mixed calls 18 conf.load('python pyqt5') 19 conf.check_python_version((2,7,4)) 20 21 def build(bld): 22 # Demonstrates mixed usage of py and pyqt5 module, and tests also install_path and install_from 23 # (since generated files go into build it has to be reset inside the pyqt5 tool) 24 bld(features="py pyqt5", source="src/sample.py src/firstgui.ui", install_path="${PREFIX}/play/", install_from="src/") 25 26 # Simple usage on a resource file. If a file referenced inside the resource changes it will be rebuilt 27 # as the qrc XML is parsed and dependencies are calculated 28 bld(features="pyqt5", source="sampleRes.qrc") 29