diff --git a/qt/aqt/__init__.py b/qt/aqt/__init__.py index 7ca034907..0ac2f3b65 100644 --- a/qt/aqt/__init__.py +++ b/qt/aqt/__init__.py @@ -61,14 +61,7 @@ mw: Optional[AnkiQt] = None # set on init moduleDir = os.path.split(os.path.dirname(os.path.abspath(__file__)))[0] -try: - import aqt.forms -except ImportError as e: - if "forms" in str(e): - print("If you're running from git, did you run build_ui.sh?") - print() - raise - +import aqt.forms # Dialog manager ########################################################################## diff --git a/qt/tools/build_ui.sh b/qt/tools/build_ui.sh deleted file mode 100755 index b72ca0c4f..000000000 --- a/qt/tools/build_ui.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -# -# generate python files based on the designer ui files. pyuic5 and pyrcc5 -# should be on the path. -# - -set -eu -o pipefail ${SHELLFLAGS} - -if [ ! -d "designer" ] -then - echo "Please run this from the project root" - exit -fi - -mkdir -p aqt/forms - -init=aqt/forms/__init__.py -temp=aqt/forms/scratch -rm -f $init $temp -echo "# This file auto-generated by build_ui.sh. Don't edit." > $init -echo "__all__ = [" >> $init - -echo "Generating forms.." -for i in designer/*.ui -do - base=$(basename $i .ui) - py="aqt/forms/${base}.py" - echo " \"$base\"," >> $init - echo "from . import $base" >> $temp - if [ $i -nt $py ]; then - echo " * "$py - pyuic5 --from-imports $i -o $py.tmp - (cat < $py -# -*- coding: utf-8 -*- -# pylint: disable=unsubscriptable-object,unused-import -EOF - rm $py.tmp - fi -done -echo "]" >> $init -cat $temp >> $init -rm $temp - -echo "Building resources.." -pyrcc5 designer/icons.qrc -o aqt/forms/icons_rc.py