#!/bin/bash

pyside2-uic M2PlotPlus.ui            -o ui_tmp0.py
pyside2-uic dg_save_as_text.ui       -o ui_tmp1.py

cat ui_tmp0.py | grep -v "import M2PlotPlus_rc" > ui2_M2PlotPlus.py
echo "try:" >> ui2_M2PlotPlus.py
echo "    import M2PlotPlus_rc" >> ui2_M2PlotPlus.py
echo "except:" >> ui2_M2PlotPlus.py
echo "    import uGao.M2PlotPlus_rc" >> ui2_M2PlotPlus.py

cat ui_tmp1.py | grep -v "coding: utf-8" | grep -v "from PySide import QtCore, QtGui" >> ui2_M2PlotPlus.py

rm ui_tmp*.py
