PluginRefactoringRope.py

branch
Py2 comp.
changeset 50
a29c3d2e6dc0
parent 48
de33dc93a3ac
child 51
db9a261d8f07
equal deleted inserted replaced
49:5c470b412f2f 50:a29c3d2e6dc0
5 5
6 """ 6 """
7 Module implementing the Rope refactoring plugin. 7 Module implementing the Rope refactoring plugin.
8 """ 8 """
9 9
10 from __future__ import unicode_literals # __IGNORE_WARNING__
11
10 import os 12 import os
13 import sys
11 14
12 from PyQt4.QtCore import QObject, QTranslator 15 from PyQt4.QtCore import QObject, QTranslator
13 16
14 from E5Gui.E5Application import e5App 17 from E5Gui.E5Application import e5App
15 18
18 # Start-Of-Header 21 # Start-Of-Header
19 name = "Refactoring Rope Plugin" 22 name = "Refactoring Rope Plugin"
20 author = "Detlev Offenbach <detlev@die-offenbachs.de>" 23 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
21 autoactivate = True 24 autoactivate = True
22 deactivateable = True 25 deactivateable = True
23 version = "2.3.1" 26 version = "2.4.0"
24 className = "RefactoringRopePlugin" 27 className = "RefactoringRopePlugin"
25 packageName = "RefactoringRope" 28 packageName = "RefactoringRope"
26 internalPackages = "rope" 29 internalPackages = "rope"
27 shortDescription = "Refactoring using the Rope library." 30 shortDescription = "Refactoring using the Rope library."
28 longDescription = """This plugin implements refactoring functionality""" \ 31 longDescription = """This plugin implements refactoring functionality""" \
29 """ using the Rope refactoring library.""" 32 """ using the Rope refactoring library.
33 Only refactoring in the same Python version as Eric is running is allowed."""
30 pyqtApi = 2 34 pyqtApi = 2
31 # End-Of-Header 35 # End-Of-Header
32 36
33 error = "" 37 error = ""
34 38
170 174
171 def __projectOpened(self): 175 def __projectOpened(self):
172 """ 176 """
173 Public slot to handle the projectOpened signal. 177 Public slot to handle the projectOpened signal.
174 """ 178 """
175 if e5App().getObject("Project").getProjectLanguage() in ["Python3"]: 179 if sys.version_info[0] == 3:
176 self.__mainAct.setEnabled(True) 180 lang = ["Python3"]
177 self.__projectIsOpen = True 181 elif sys.version_info[0] == 2:
182 lang = ["Python", "Python2"]
183 else:
184 lang = []
185
186 if e5App().getObject("Project").getProjectLanguage() in lang:
187 self.__mainAct.setEnabled(True)
188 self.__projectIsOpen = True
178 189
179 def __projectClosed(self): 190 def __projectClosed(self):
180 """ 191 """
181 Public slot to handle the projectClosed signal. 192 Public slot to handle the projectClosed signal.
182 """ 193 """

eric ide

mercurial