377 for name in namelist: |
377 for name in namelist: |
378 self.progress.setValue(prog) |
378 self.progress.setValue(prog) |
379 QApplication.processEvents() |
379 QApplication.processEvents() |
380 prog += 1 |
380 prog += 1 |
381 if name == pluginFileName or \ |
381 if name == pluginFileName or \ |
382 name.startswith("%s/" % packageName) or \ |
382 name.startswith("{0}/".format(packageName)) or \ |
383 name.startswith("%s\\" % packageName): |
383 name.startswith("{0}\\".format(packageName)): |
384 outname = name.replace("/", os.sep) |
384 outname = name.replace("/", os.sep) |
385 outname = os.path.join(destination, outname) |
385 outname = os.path.join(destination, outname) |
386 if outname.endswith("/") or outname.endswith("\\"): |
386 if outname.endswith("/") or outname.endswith("\\"): |
387 # it is a directory entry |
387 # it is a directory entry |
388 outname = outname[:-1] |
388 outname = outname[:-1] |
487 |
487 |
488 try: |
488 try: |
489 if packageDir and os.path.exists(packageDir): |
489 if packageDir and os.path.exists(packageDir): |
490 shutil.rmtree(packageDir) |
490 shutil.rmtree(packageDir) |
491 |
491 |
492 fnameo = "%so" % pluginFile |
492 fnameo = "{0}o".format(pluginFile) |
493 if os.path.exists(fnameo): |
493 if os.path.exists(fnameo): |
494 os.remove(fnameo) |
494 os.remove(fnameo) |
495 |
495 |
496 fnamec = "%sc" % pluginFile |
496 fnamec = "{0}c".format(pluginFile) |
497 if os.path.exists(fnamec): |
497 if os.path.exists(fnamec): |
498 os.remove(fnamec) |
498 os.remove(fnamec) |
499 |
499 |
500 os.remove(pluginFile) |
500 os.remove(pluginFile) |
501 except (IOError, OSError, os.error): |
501 except (IOError, OSError, os.error): |