eric7/PluginManager/PluginInstallDialog.py

branch
eric7
changeset 8943
23f9c7b9e18e
parent 8881
54e42bc2437a
child 9152
8a68afaf1ba2
equal deleted inserted replaced
8940:e91951ff3bbd 8943:23f9c7b9e18e
5 5
6 """ 6 """
7 Module implementing the Plugin installation dialog. 7 Module implementing the Plugin installation dialog.
8 """ 8 """
9 9
10 import compileall
11 import contextlib
12 import glob
10 import os 13 import os
14 import shutil
11 import sys 15 import sys
12 import shutil 16 import time
17 import urllib.parse
13 import zipfile 18 import zipfile
14 import compileall
15 import glob
16 import contextlib
17 import urllib.parse
18 19
19 from PyQt6.QtCore import pyqtSlot, Qt, QDir, QFileInfo 20 from PyQt6.QtCore import pyqtSlot, Qt, QDir, QFileInfo
20 from PyQt6.QtWidgets import ( 21 from PyQt6.QtWidgets import (
21 QWidget, QDialogButtonBox, QAbstractButton, QApplication, QDialog, 22 QWidget, QDialogButtonBox, QAbstractButton, QApplication, QDialog,
22 QVBoxLayout 23 QVBoxLayout
438 if packageName != "None": 439 if packageName != "None":
439 namelist = sorted(zipFile.namelist()) 440 namelist = sorted(zipFile.namelist())
440 tot = len(namelist) 441 tot = len(namelist)
441 self.progress.setMaximum(tot) 442 self.progress.setMaximum(tot)
442 QApplication.processEvents() 443 QApplication.processEvents()
444
445 now = time.monotonic()
443 for prog, name in enumerate(namelist): 446 for prog, name in enumerate(namelist):
444 self.progress.setValue(prog) 447 self.progress.setValue(prog)
445 QApplication.processEvents() 448 if time.monotonic() - now > 0.01:
449 QApplication.processEvents()
450 now = time.monotonic()
446 if ( 451 if (
447 name == pluginFileName or 452 name == pluginFileName or
448 name.startswith("{0}/".format(packageName)) or 453 name.startswith("{0}/".format(packageName)) or
449 name.startswith("{0}\\".format(packageName)) 454 name.startswith("{0}\\".format(packageName))
450 ): 455 ):

eric ide

mercurial