RefactoringRope/CodeAssistServer.py

changeset 269
02bf946efbdc
parent 263
a2fee57f83cf
child 270
efc48da49a75
equal deleted inserted replaced
268:9a58fbb3786e 269:02bf946efbdc
523 @rtype bool 523 @rtype bool
524 """ 524 """
525 ok = idString in self.connectionNames() 525 ok = idString in self.connectionNames()
526 if not ok: 526 if not ok:
527 # client is not running 527 # client is not running
528 if idString == "Python2": 528 try:
529 # Python 2 529 # new code using virtual environments
530 interpreter = Preferences.getDebugger("PythonInterpreter") 530 if idString == "Python2":
531 ok = self.__startCodeAssistClient(interpreter, "Python2") 531 # Python 2
532 elif idString == "Python3": 532 venvName = Preferences.getDebugger("Python2VirtualEnv")
533 # Python 3 533 elif idString == "Python3":
534 interpreter = Preferences.getDebugger("Python3Interpreter") 534 # Python 3
535 ok = self.__startCodeAssistClient(interpreter, "Python3") 535 venvName = Preferences.getDebugger("Python3VirtualEnv")
536 else:
537 venvName = ""
538 if venvName:
539 interpreter = e5App().getObject("VirtualEnvManager")\
540 .getVirtualenvInterpreter(venvName)
541 except KeyError:
542 # backward compatibility (eric <18.07)
543 if idString == "Python2":
544 # Python 2
545 interpreter = Preferences.getDebugger("PythonInterpreter")
546 elif idString == "Python3":
547 # Python 3
548 interpreter = Preferences.getDebugger("Python3Interpreter")
549 else:
550 interpreter = ""
551 if interpreter:
552 ok = self.__startCodeAssistClient(interpreter, idString)
536 return ok 553 return ok
537 554
538 @pyqtSlot() 555 @pyqtSlot()
539 def handleNewConnection(self): 556 def handleNewConnection(self):
540 """ 557 """

eric ide

mercurial