16 |
16 |
17 from E5Gui.E5Application import e5App |
17 from E5Gui.E5Application import e5App |
18 from E5Gui import E5MessageBox |
18 from E5Gui import E5MessageBox |
19 from E5Gui.E5Action import E5Action |
19 from E5Gui.E5Action import E5Action |
20 |
20 |
21 from .JsonServer import JsonServer |
21 try: |
|
22 from E5Network.E5JsonServer import E5JsonServer |
|
23 except ImportError: |
|
24 # TODO: delete JsonServer once ported to eric7 |
|
25 from .JsonServer import JsonServer as E5JsonServer |
22 from .RopeProgressDialog import RopeProgressDialog |
26 from .RopeProgressDialog import RopeProgressDialog |
23 |
27 |
24 import Utilities |
28 import Utilities |
25 import Preferences |
29 import Preferences |
|
30 import Globals |
26 |
31 |
27 from Preferences.Shortcuts import readShortcuts |
32 from Preferences.Shortcuts import readShortcuts |
28 |
33 |
29 |
34 |
30 class RefactoringServer(JsonServer): |
35 class RefactoringServer(E5JsonServer): |
31 """ |
36 """ |
32 Class implementing the refactoring interface to rope. |
37 Class implementing the refactoring interface to rope. |
33 """ |
38 """ |
34 def __init__(self, plugin, parent=None): |
39 def __init__(self, plugin, parent=None): |
35 """ |
40 """ |
2256 @rtype bool |
2261 @rtype bool |
2257 """ |
2262 """ |
2258 if interpreter: |
2263 if interpreter: |
2259 client = os.path.join(os.path.dirname(__file__), |
2264 client = os.path.join(os.path.dirname(__file__), |
2260 "RefactoringClient.py") |
2265 "RefactoringClient.py") |
2261 ok = self.startClient(interpreter, client, [self.__projectpath], |
2266 ok, exitCode = self.startClient( |
2262 environment=clientEnv) |
2267 interpreter, client, |
|
2268 [self.__projectpath, Globals.getPythonModulesDirectory()], |
|
2269 environment=clientEnv) |
|
2270 if not ok and exitCode == 42: |
|
2271 self.__ui.appendToStderr("RefactoringServer: " + self.tr( |
|
2272 "The rope refactoring library is not installed.\n" |
|
2273 )) |
2263 else: |
2274 else: |
2264 ok = False |
2275 ok = False |
2265 return ok |
2276 return ok |