Project/Project.py

branch
5_1_x
changeset 1160
5e63e3cfc980
parent 1159
43d3b178ae5b
child 1174
53ae8212ccdb
equal deleted inserted replaced
1159:43d3b178ae5b 1160:5e63e3cfc980
1723 path, 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): 1726 if os.path.isfile(fn2):
1727 os.remove(fn2) 1727 os.remove(fn2)
1728 head, tail = os.path.split(path)
1728 for ext in ['.pyc', '.pyo']: 1729 for ext in ['.pyc', '.pyo']:
1729 fn2 = path + ext 1730 fn2 = os.path.join(self.ppath, path + ext)
1730 if os.path.isfile(fn2): 1731 if os.path.isfile(fn2):
1731 os.remove(fn2) 1732 os.remove(fn2)
1733 pat = os.path.join(
1734 self.ppath, head, "__pycache__", "{0}.*{1}".format(tail, ext))
1735 for f in glob.glob(pat):
1736 os.remove(f)
1732 except EnvironmentError: 1737 except EnvironmentError:
1733 E5MessageBox.critical(self.ui, 1738 E5MessageBox.critical(self.ui,
1734 self.trUtf8("Delete file"), 1739 self.trUtf8("Delete file"),
1735 self.trUtf8("<p>The selected file <b>{0}</b> could not be deleted.</p>") 1740 self.trUtf8("<p>The selected file <b>{0}</b> could not be deleted.</p>")
1736 .format(fn)) 1741 .format(fn))

eric ide

mercurial