8554:167c78918573 | 8555:844c2713bf44 |
---|---|
14 | 14 |
15 import collections | 15 import collections |
16 import os | 16 import os |
17 import re | 17 import re |
18 | 18 |
19 from PyQt6.QtCore import QObject, QUrl, QFile, QFileInfo, qWarning | 19 from PyQt6.QtCore import QObject, QUrl, QFile, QFileInfo, QIODevice, qWarning |
20 | 20 |
21 from EricWidgets import EricMessageBox | 21 from EricWidgets import EricMessageBox |
22 | 22 |
23 | 23 |
24 class EricTldHostParts: | 24 class EricTldHostParts: |
318 # start with a fresh dictionary | 318 # start with a fresh dictionary |
319 self.__tldDict = collections.defaultdict(list) | 319 self.__tldDict = collections.defaultdict(list) |
320 | 320 |
321 file = QFile(dataFile) | 321 file = QFile(dataFile) |
322 | 322 |
323 if not file.open(QFile.ReadOnly | QFile.Text): | 323 if not file.open(QIODevice.OpenModeFlag.ReadOnly | QIODevice.OpenModeFlag.Text): |
324 return False | 324 return False |
325 | 325 |
326 seekToEndOfPrivateDomains = False | 326 seekToEndOfPrivateDomains = False |
327 | 327 |
328 while not file.atEnd(): | 328 while not file.atEnd(): |
477 ) | 477 ) |
478 return False | 478 return False |
479 | 479 |
480 file = QFile(testDataFileName) | 480 file = QFile(testDataFileName) |
481 | 481 |
482 if not file.open(QFile.ReadOnly | QFile.Text): | 482 if not file.open(QIODevice.OpenModeFlag.ReadOnly | QIODevice.OpenModeFlag.Text): |
483 return False | 483 return False |
484 | 484 |
485 testRegExp = re.compile( | 485 testRegExp = re.compile( |
486 "checkPublicSuffix\\(('([^']+)'|null), ('([^']+)'|null)\\);") | 486 "checkPublicSuffix\\(('([^']+)'|null), ('([^']+)'|null)\\);") |
487 allTestSuccess = True | 487 allTestSuccess = True |