1
0
Fork 0
mirror of synced 2024-06-27 18:51:06 +12:00
Rare/misc/ui2py.sh
loathingKernel d3bee28443 Ui: Delete QtCore.QMetaObject.connectSlotsByName from UI python files
Since pyuic5 doesn't handle `connectSlotByName=False` in ui files
use sed in `misc/ui2py.sh` to remove those lines

Signed-off-by: loathingKernel <142770+loathingKernel@users.noreply.github.com>
2023-02-04 17:38:07 +02:00

21 lines
432 B
Bash
Executable file

#!/bin/sh
if [ ! -z "${1}" ]; then
echo "Generating python file for ${1}"
pyuic5 "${1}" -x -o "${1%.ui}.py"
exit 0
fi
cwd="$(pwd)"
cd "$(dirname "$0")"/.. || exit
changed="$(git diff --name-only HEAD | grep '\.ui')"
for ui in $changed; do
echo "Generating python file for ${ui}"
pyuic5 "${ui}" -x -o "${ui%.ui}.py"
sed '/QtCore.QMetaObject.connectSlotsByName/d' -i "${ui%.ui}.py"
done
cd "$cwd" || exit