PluginManager/PluginInstallDialog.py

changeset 48
f4274afeba82
parent 45
9a18f4dbb493
child 55
b5c84934de9c
equal deleted inserted replaced
47:884e62c0b9cb 48:f4274afeba82
266 return False, \ 266 return False, \
267 self.trUtf8("""<p>The destination directory <b>{0}</b> is not """ 267 self.trUtf8("""<p>The destination directory <b>{0}</b> is not """
268 """writeable. Aborting...</p>""").format(destination), \ 268 """writeable. Aborting...</p>""").format(destination), \
269 False 269 False
270 270
271 zip = zipfile.ZipFile(archive, "r") 271 zip = zipfile.ZipFile(archive, "rb")
272 272
273 # check, if the archive contains a valid plugin 273 # check, if the archive contains a valid plugin
274 pluginFound = False 274 pluginFound = False
275 pluginFileName = "" 275 pluginFileName = ""
276 for name in zip.namelist(): 276 for name in zip.namelist():
285 self.trUtf8("""<p>The file <b>{0}</b> is not a valid plugin """ 285 self.trUtf8("""<p>The file <b>{0}</b> is not a valid plugin """
286 """ZIP-archive. Aborting...</p>""").format(archive), \ 286 """ZIP-archive. Aborting...</p>""").format(archive), \
287 False 287 False
288 288
289 # parse the plugin module's plugin header 289 # parse the plugin module's plugin header
290 pluginSource = zip.read(pluginFileName).decode("utf-8") 290 pluginSource = Utilities.decode(zip.read(pluginFileName))[0]
291 packageName = "" 291 packageName = ""
292 internalPackages = [] 292 internalPackages = []
293 needsRestart = False 293 needsRestart = False
294 pyqtApi = 0 294 pyqtApi = 0
295 for line in pluginSource.splitlines(): 295 for line in pluginSource.splitlines():

eric ide

mercurial