38 """ |
38 """ |
39 super(MigrateProject, self).__init__(parent) |
39 super(MigrateProject, self).__init__(parent) |
40 |
40 |
41 self.__plugin = plugin |
41 self.__plugin = plugin |
42 self.__project = project |
42 self.__project = project |
43 |
|
44 # TODO: move virtual env stuff to Project |
|
45 self.__virtualEnvManager = e5App().getObject("VirtualEnvManager") |
|
46 |
43 |
47 def initActions(self): |
44 def initActions(self): |
48 """ |
45 """ |
49 Public method to define the flask-migrate actions. |
46 Public method to define the flask-migrate actions. |
50 """ |
47 """ |
147 Private method to check, if the 'flask-babel' package is available. |
144 Private method to check, if the 'flask-babel' package is available. |
148 |
145 |
149 @return flag indicating the availability of 'flask-babel' |
146 @return flag indicating the availability of 'flask-babel' |
150 @rtype bool |
147 @rtype bool |
151 """ |
148 """ |
152 venvName = self.__plugin.getPreferences("VirtualEnvironmentNamePy3") |
149 interpreter = self.__project.getVirtualenvInterpreter() |
153 interpreter = self.__virtualEnvManager.getVirtualenvInterpreter( |
|
154 venvName) |
|
155 if interpreter and Utilities.isinpath(interpreter): |
150 if interpreter and Utilities.isinpath(interpreter): |
156 detector = os.path.join( |
151 detector = os.path.join( |
157 os.path.dirname(__file__), "FlaskMigrateDetector.py") |
152 os.path.dirname(__file__), "FlaskMigrateDetector.py") |
158 proc = QProcess() |
153 proc = QProcess() |
159 proc.setProcessChannelMode(QProcess.MergedChannels) |
154 proc.setProcessChannelMode(QProcess.MergedChannels) |