5 |
5 |
6 """ |
6 """ |
7 Module implementing the refactoring interface to rope. |
7 Module implementing the refactoring interface to rope. |
8 """ |
8 """ |
9 |
9 |
|
10 from __future__ import unicode_literals |
|
11 |
10 import os |
12 import os |
11 import sys |
13 import sys |
12 |
14 |
13 sys.path.insert(0, os.path.dirname(__file__)) |
15 sys.path.insert(0, os.path.dirname(__file__)) |
|
16 if sys.version_info[0] >= 3: |
|
17 path = os.path.join(os.path.dirname(__file__), 'rope_py3') |
|
18 else: |
|
19 path = os.path.join(os.path.dirname(__file__), 'rope_py2') |
|
20 str = unicode # __IGNORE_WARNING__ |
|
21 sys.path.insert(0, path) |
|
22 |
14 import rope |
23 import rope |
15 import rope.base.libutils |
24 import rope.base.libutils |
16 import rope.base.exceptions |
25 import rope.base.exceptions |
17 |
26 |
18 from PyQt4.QtCore import QObject |
27 from PyQt4.QtCore import QObject |
2080 """ |
2089 """ |
2081 Private slot to show help about the refactorings offered by Rope. |
2090 Private slot to show help about the refactorings offered by Rope. |
2082 """ |
2091 """ |
2083 if self.__helpDialog is None: |
2092 if self.__helpDialog is None: |
2084 from HelpDialog import HelpDialog |
2093 from HelpDialog import HelpDialog |
|
2094 if sys.version_info[0] >= 3: |
|
2095 dir = 'rope_py3' |
|
2096 else: |
|
2097 dir = 'rope_py2' |
2085 helpfile = os.path.join(os.path.dirname(__file__), |
2098 helpfile = os.path.join(os.path.dirname(__file__), |
2086 "rope", "docs", "overview.txt") |
2099 dir, "rope", "docs", "overview.txt") |
2087 self.__helpDialog = \ |
2100 self.__helpDialog = \ |
2088 HelpDialog(self.trUtf8("Help about rope refactorings"), |
2101 HelpDialog(self.trUtf8("Help about rope refactorings"), |
2089 helpfile) |
2102 helpfile) |
2090 self.__helpDialog.show() |
2103 self.__helpDialog.show() |
2091 |
2104 |
2177 |
2190 |
2178 self.__projectopen = True |
2191 self.__projectopen = True |
2179 self.__projectpath = self.__e5project.getProjectPath() |
2192 self.__projectpath = self.__e5project.getProjectPath() |
2180 self.__projectLanguage = self.__e5project.getProjectLanguage() |
2193 self.__projectLanguage = self.__e5project.getProjectLanguage() |
2181 |
2194 |
2182 if self.__projectLanguage in ["Python3"]: |
2195 if self.__projectLanguage.startswith("Python"): |
2183 import rope.base.project |
2196 import rope.base.project |
2184 self.__project = rope.base.project.Project( |
2197 self.__project = rope.base.project.Project( |
2185 self.__projectpath, fscommands=self.__fsCommands) |
2198 self.__projectpath, fscommands=self.__fsCommands) |
2186 for act in self.actions: |
2199 for act in self.actions: |
2187 act.setEnabled(True) |
2200 act.setEnabled(True) |