1718 @param fn filename to be deleted from the project |
1718 @param fn filename to be deleted from the project |
1719 @return flag indicating success (boolean) |
1719 @return flag indicating success (boolean) |
1720 """ |
1720 """ |
1721 try: |
1721 try: |
1722 os.remove(os.path.join(self.ppath, fn)) |
1722 os.remove(os.path.join(self.ppath, fn)) |
1723 dummy, ext = os.path.splitext(fn) |
1723 path, ext = os.path.splitext(fn) |
1724 if ext == '.ui': |
1724 if ext == '.ui': |
1725 fn2 = os.path.join(self.ppath, '{0}.h'.format(fn)) |
1725 fn2 = os.path.join(self.ppath, '{0}.h'.format(fn)) |
|
1726 if os.path.isfile(fn2): |
|
1727 os.remove(fn2) |
|
1728 for ext in ['.pyc', '.pyo']: |
|
1729 fn2 = path + ext |
1726 if os.path.isfile(fn2): |
1730 if os.path.isfile(fn2): |
1727 os.remove(fn2) |
1731 os.remove(fn2) |
1728 except EnvironmentError: |
1732 except EnvironmentError: |
1729 E5MessageBox.critical(self.ui, |
1733 E5MessageBox.critical(self.ui, |
1730 self.trUtf8("Delete file"), |
1734 self.trUtf8("Delete file"), |