added script for rebuilding ui files for pyside

This commit is contained in:
Luke Campagnola 2012-03-01 22:23:51 -05:00
parent 4c525ffa06
commit 9baa011638

16
rebuildUi.py Normal file
View File

@ -0,0 +1,16 @@
import os, sys
## run "python rebuildUi.py pyside" to rebuild all ui files for pyside
uic = 'pyuic4'
if len(sys.argv) > 1 and sys.argv[1] == 'pyside':
uic = 'pyside-uic'
for path, sd, files in os.walk('.'):
for f in files:
base, ext = os.path.splitext(f)
if ext != '.ui':
continue
ui = os.path.join(path, f)
py = os.path.join(path, base + '.py')
os.system('%s %s > %s' % (uic, ui, py))
print py