Project/Project.py

changeset 1158
33dce2093b6f
parent 1157
31644008f9b2
child 1172
a183f45d3553
equal deleted inserted replaced
1157:31644008f9b2 1158:33dce2093b6f
1724 path, 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): 1727 if os.path.isfile(fn2):
1728 os.remove(fn2) 1728 os.remove(fn2)
1729 head, tail = os.path.split(path)
1729 for ext in ['.pyc', '.pyo']: 1730 for ext in ['.pyc', '.pyo']:
1730 fn2 = path + ext 1731 fn2 = os.path.join(self.ppath, path + ext)
1731 if os.path.isfile(fn2): 1732 if os.path.isfile(fn2):
1732 os.remove(fn2) 1733 os.remove(fn2)
1734 pat = os.path.join(
1735 self.ppath, head, "__pycache__", "{0}.*{1}".format(tail, ext))
1736 for f in glob.glob(pat):
1737 os.remove(f)
1733 except EnvironmentError: 1738 except EnvironmentError:
1734 E5MessageBox.critical(self.ui, 1739 E5MessageBox.critical(self.ui,
1735 self.trUtf8("Delete file"), 1740 self.trUtf8("Delete file"),
1736 self.trUtf8("<p>The selected file <b>{0}</b> could not be deleted.</p>") 1741 self.trUtf8("<p>The selected file <b>{0}</b> could not be deleted.</p>")
1737 .format(fn)) 1742 .format(fn))

eric ide

mercurial