pylint is confused by pyqt subscript notation

This commit is contained in:
Damien Elmes 2019-03-04 12:25:54 +10:00
parent 919738a9d7
commit dfbbeab8db

View File

@ -28,9 +28,11 @@ do
if [ $i -nt $py ]; then if [ $i -nt $py ]; then
echo " * "$py echo " * "$py
pyuic5 --from-imports $i -o $py.tmp pyuic5 --from-imports $i -o $py.tmp
# munge the output to use gettext (cat <<EOF; tail -n +3 $py.tmp) | perl -p -e 's/(QtGui\.QApplication\.)?_?translate\(".*?", /_(/; s/, None.*/))/' > $py
cat $py.tmp | sed "/WARNING/ a\\ # -*- coding: utf-8 -*-
from anki.lang import _" | perl -p -e 's/(QtGui\.QApplication\.)?_?translate\(".*?", /_(/; s/, None.*/))/' > $py # pylint: disable=unsubscriptable-object
from anki.lang import _
EOF
rm $py.tmp rm $py.tmp
fi fi
done done