12 import contextlib |
12 import contextlib |
13 import os |
13 import os |
14 |
14 |
15 from PyQt6.QtCore import QObject, QTimer |
15 from PyQt6.QtCore import QObject, QTimer |
16 |
16 |
17 from eric7 import Globals, Preferences |
17 from eric7 import EricUtilities, Preferences |
18 |
18 |
19 with contextlib.suppress(ImportError, AttributeError, OSError): |
19 with contextlib.suppress(ImportError, AttributeError, OSError): |
20 import enchant |
20 import enchant |
21 |
21 |
22 |
22 |
96 @return file name of the default user dictionary or the default user |
96 @return file name of the default user dictionary or the default user |
97 exception dictionary |
97 exception dictionary |
98 @rtype str |
98 @rtype str |
99 """ |
99 """ |
100 if isException: |
100 if isException: |
101 return os.path.join(Globals.getConfigDir(), "spelling", "pel.dic") |
101 return os.path.join(EricUtilities.getConfigDir(), "spelling", "pel.dic") |
102 else: |
102 else: |
103 return os.path.join(Globals.getConfigDir(), "spelling", "pwl.dic") |
103 return os.path.join(EricUtilities.getConfigDir(), "spelling", "pwl.dic") |
104 |
104 |
105 @classmethod |
105 @classmethod |
106 def getUserDictionaryPath(cls, isException=False): |
106 def getUserDictionaryPath(cls, isException=False): |
107 """ |
107 """ |
108 Class method to get the path name of a user dictionary file. |
108 Class method to get the path name of a user dictionary file. |