RefactoringRope/CodeAssistClient.py

branch
eric7
changeset 409
65153bf17e8d
parent 389
4f53795beff0
child 411
8cccb49bba7b
equal deleted inserted replaced
408:19321ca1a6d1 409:65153bf17e8d
5 5
6 """ 6 """
7 Module implementing the code assist client interface to rope. 7 Module implementing the code assist client interface to rope.
8 """ 8 """
9 9
10 import contextlib
10 import sys 11 import sys
11 import contextlib
12 12
13 modulePath = sys.argv[-1] # it is always the last parameter 13 modulePath = sys.argv[-1] # it is always the last parameter
14 sys.path.append(modulePath) 14 sys.path.append(modulePath)
15 15
16 try: 16 try:
17 import rope.base.libutils
17 import rope.base.project 18 import rope.base.project
18 import rope.base.libutils
19 import rope.contrib.codeassist 19 import rope.contrib.codeassist
20
20 from rope.base.exceptions import BadIdentifierError, ModuleSyntaxError 21 from rope.base.exceptions import BadIdentifierError, ModuleSyntaxError
21 except ImportError: 22 except ImportError:
22 sys.exit(42) 23 sys.exit(42)
23 24
24 from eric7.EricNetwork.EricJsonClient import EricJsonClient 25 from eric7.EricNetwork.EricJsonClient import EricJsonClient
361 @param maxfixes number of fixes to be done 362 @param maxfixes number of fixes to be done
362 @type int 363 @type int
363 @return tuple containing the object type and name 364 @return tuple containing the object type and name
364 @rtype tuple of (str, str) 365 @rtype tuple of (str, str)
365 """ 366 """
366 from rope.base import pyobjects, pyobjectsdef, pynames 367 from rope.base import pynames, pyobjects, pyobjectsdef
367 from rope.contrib import fixsyntax 368 from rope.contrib import fixsyntax
368 369
369 try: 370 try:
370 fixer = fixsyntax.FixSyntax(project, sourceCode, resource, maxfixes) 371 fixer = fixsyntax.FixSyntax(project, sourceCode, resource, maxfixes)
371 pyname = fixer.pyname_at(offset) 372 pyname = fixer.pyname_at(offset)

eric ide

mercurial