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(): |