PluginCxFreeze.py

changeset 50
ed85ec1358f0
parent 47
986f27beaad4
child 52
43d760ff8b3f
equal deleted inserted replaced
47:986f27beaad4 50:ed85ec1358f0
13 import platform 13 import platform
14 14
15 from PyQt4.QtCore import QObject, QTranslator, QCoreApplication 15 from PyQt4.QtCore import QObject, QTranslator, QCoreApplication
16 from PyQt4.QtGui import QDialog 16 from PyQt4.QtGui import QDialog
17 17
18 from E5Gui import E5MessageBox 18 try:
19 from E5Gui.E5Action import E5Action 19 from E5Gui import E5MessageBox
20 from E5Gui.E5Application import e5App 20 from E5Gui.E5Action import E5Action
21 from E5Gui.E5Application import e5App
22 suitable = True
23 except ImportError:
24 suitable = False
21 25
22 import Utilities 26 import Utilities
23 27
24 # Start-of-Header 28 # Start-of-Header
25 name = "CxFreeze Plugin" 29 name = "CxFreeze Plugin"
192 196
193 @return flag indicating availability (boolean) 197 @return flag indicating availability (boolean)
194 """ 198 """
195 global error, exePy2, exePy3 199 global error, exePy2, exePy3
196 200
201 if not suitable:
202 error = QCoreApplication.translate("CxFreezePlugin", """Your version of Eric5 is not supported.
203 At least version 5.1.0 of Eric5 is needed.""")
204 return False
205
197 exePy2 = _findExecutable(2) 206 exePy2 = _findExecutable(2)
198 exePy3 = _findExecutable(3) 207 exePy3 = _findExecutable(3)
199 if (exePy2+exePy3) == []: 208 if (exePy2+exePy3) == []:
200 error = QCoreApplication.translate("CxFreezePlugin", 209 error = QCoreApplication.translate("CxFreezePlugin",
201 "The cxfreeze executable could not be found.") 210 "The cxfreeze executable could not be found.")
202 return False 211 return False
203 else: 212 else:
204 return True 213 return True
205 214 _checkProgram()
206 215
207 class CxFreezePlugin(QObject): 216 class CxFreezePlugin(QObject):
208 """ 217 """
209 Class implementing the CxFreeze plugin. 218 Class implementing the CxFreeze plugin.
210 """ 219 """
225 def __initialize(self): 234 def __initialize(self):
226 """ 235 """
227 Private slot to (re)initialize the plugin. 236 Private slot to (re)initialize the plugin.
228 """ 237 """
229 self.__projectAct = None 238 self.__projectAct = None
230 239
231 def activate(self): 240 def activate(self):
232 """ 241 """
233 Public method to activate this plugin. 242 Public method to activate this plugin.
234 243
235 @return tuple of None and activation status (boolean) 244 @return tuple of None and activation status (boolean)

eric ide

mercurial