PluginManager/PluginUninstallDialog.py

changeset 2854
2de1955c6391
parent 2824
858412c29c34
child 2889
3737e9f17f44
child 2911
ce77f0b1ee67
equal deleted inserted replaced
2853:0866c3aac79f 2854:2de1955c6391
9 9
10 import sys 10 import sys
11 import os 11 import os
12 import imp 12 import imp
13 import shutil 13 import shutil
14 import glob
14 15
15 from PyQt4.QtCore import pyqtSlot, pyqtSignal 16 from PyQt4.QtCore import pyqtSlot, pyqtSignal
16 from PyQt4.QtGui import QWidget, QDialog, QDialogButtonBox, QVBoxLayout 17 from PyQt4.QtGui import QWidget, QDialog, QDialogButtonBox, QVBoxLayout
17 18
18 from E5Gui import E5MessageBox 19 from E5Gui import E5MessageBox
141 142
142 fnamec = "{0}c".format(pluginFile) 143 fnamec = "{0}c".format(pluginFile)
143 if os.path.exists(fnamec): 144 if os.path.exists(fnamec):
144 os.remove(fnamec) 145 os.remove(fnamec)
145 146
147 pluginDirCache = os.path.join(os.path.dirname(pluginFile), "__pycache__")
148 if os.path.exists(pluginDirCache):
149 pluginFileName = os.path.splitext(os.path.basename(pluginFile))[0]
150 for fnameo in glob.glob(
151 os.path.join(pluginDirCache, "{0}*.pyo".format(pluginFileName))):
152 os.remove(fnameo)
153 for fnamec in glob.glob(
154 os.path.join(pluginDirCache, "{0}*.pyc".format(pluginFileName))):
155 os.remove(fnamec)
156
146 os.remove(pluginFile) 157 os.remove(pluginFile)
147 except OSError as err: 158 except OSError as err:
148 E5MessageBox.critical(self, 159 E5MessageBox.critical(self,
149 self.trUtf8("Plugin Uninstallation"), 160 self.trUtf8("Plugin Uninstallation"),
150 self.trUtf8("""<p>The plugin package <b>{0}</b> could not be""" 161 self.trUtf8("""<p>The plugin package <b>{0}</b> could not be"""

eric ide

mercurial