55)
66
77from .context .parameterContext import ParameterContext
8- from .exceptions import WhoisQuotaExceeded
8+ from .exceptions import WhoisQuotaExceededError
99from .tldDb .tld_regexpr import ZZ
1010from .tldInfo import TldInfo
1111from .version import VERSION
1717def filterTldToSupportedPattern (
1818 dList : list [str ],
1919) -> str | None :
20- global tldInfo
21- return tldInfo .filterTldToSupportedPattern (dList )
20+ global MY_TLD_INFO
21+ return MY_TLD_INFO .filterTldToSupportedPattern (dList )
2222
2323
2424def mergeExternalDictWithRegex (
2525 aDict : dict [str , Any ] | None = None ,
2626) -> None :
27- global tldInfo
27+ global MY_TLD_INFO
2828 if aDict is None :
2929 return
3030 if len (aDict ) == 0 :
3131 return
3232
33- tldInfo .mergeExternalDictWithRegex (aDict )
33+ MY_TLD_INFO .mergeExternalDictWithRegex (aDict )
3434
3535
3636def validTlds () -> list [str ]:
37- global tldInfo
38- return tldInfo .validTlds ()
37+ global MY_TLD_INFO
38+ return MY_TLD_INFO .validTlds ()
3939
4040
4141def get_TLD_RE () -> dict [str , dict [str , Any ]]:
42- global tldInfo
43- return tldInfo .TLD_RE ()
42+ global MY_TLD_INFO
43+ return MY_TLD_INFO .TLD_RE ()
4444
4545
4646def getVersion () -> str :
@@ -76,7 +76,7 @@ def cleanupWhoisResponse(
7676 for line in tmp :
7777 # some servers respond with: % Quota exceeded in the comment section (lines starting with %)
7878 if "quota exceeded" in line .lower ():
79- raise WhoisQuotaExceeded (whoisStr )
79+ raise WhoisQuotaExceededError (whoisStr )
8080
8181 if pc .with_cleanup_results is True and line .startswith ("%" ): # only remove if requested
8282 continue
@@ -97,6 +97,6 @@ def cleanupWhoisResponse(
9797
9898VERBOSE : bool = False
9999
100- # Here we focre load on import the processing of the ZZ database
101- tldInfo = TldInfo (ZZ , verbose = VERBOSE )
102- tldInfo .init () # must run on import
100+ # Here we force- load on import the processing of the ZZ database
101+ MY_TLD_INFO = TldInfo (ZZ , verbose = VERBOSE )
102+ MY_TLD_INFO .init () # must run on import
0 commit comments