RefactoringRope/RefactoringClient.py

changeset 362
792c2651fbd7
parent 360
2b35968f3d02
child 365
f740b50380df
equal deleted inserted replaced
361:51afc1818188 362:792c2651fbd7
9 9
10 import sys 10 import sys
11 import os 11 import os
12 import contextlib 12 import contextlib
13 13
14 modulePath = sys.argv[-1] # it is always the last parameter
15 sys.path.insert(1, modulePath)
16
14 try: 17 try:
15 from E5Network.E5JsonClient import E5JsonClient 18 import rope.base.project
19 import rope.base.libutils
20 except ImportError:
21 sys.exit(42)
22
23 from ProgressHandle import ProgressHandle
24
25 try:
26 from eric6.E5Network.E5JsonClient import E5JsonClient
16 except ImportError: 27 except ImportError:
17 # TODO: delete JsonClient once ported to eric7 28 # TODO: delete JsonClient once ported to eric7
18 from JsonClient import JsonClient as E5JsonClient 29 from JsonClient import JsonClient as E5JsonClient
19 30
20 31
1495 if len(sys.argv) != 5: 1506 if len(sys.argv) != 5:
1496 print('Host, port, project path and module path parameters are' 1507 print('Host, port, project path and module path parameters are'
1497 ' missing. Abort.') 1508 ' missing. Abort.')
1498 sys.exit(1) 1509 sys.exit(1)
1499 1510
1500 host, port, projectPath, modulePath = sys.argv[1:] 1511 host, port, projectPath = sys.argv[1:-1]
1501
1502 sys.path.insert(1, modulePath)
1503 try:
1504 import rope.base.project
1505 import rope.base.libutils
1506 from ProgressHandle import ProgressHandle
1507 except ImportError:
1508 sys.exit(42)
1509 1512
1510 # Create a Qt5 application object in order to allow the processing of 1513 # Create a Qt5 application object in order to allow the processing of
1511 # modules containing Qt stuff. 1514 # modules containing Qt stuff.
1512 try: 1515 try:
1513 from PyQt5.QtCore import QCoreApplication 1516 from PyQt5.QtCore import QCoreApplication

eric ide

mercurial