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