PluginCxFreeze.py

changeset 54
d14ff08ea519
parent 52
43d760ff8b3f
child 56
c8a47a8536b0
equal deleted inserted replaced
53:bf44b03905d0 54:d14ff08ea519
17 17
18 try: 18 try:
19 from E5Gui import E5MessageBox 19 from E5Gui import E5MessageBox
20 from E5Gui.E5Action import E5Action 20 from E5Gui.E5Action import E5Action
21 from E5Gui.E5Application import e5App 21 from E5Gui.E5Application import e5App
22 suitable = True 22 error = ""
23 except ImportError: 23 except ImportError:
24 suitable = False 24 error = QCoreApplication.translate("CxFreezePlugin",
25 """Your version of Eric5 is not supported."""
26 """ At least version 5.1.0 of Eric5 is needed.""")
27
25 28
26 import Utilities 29 import Utilities
27 30
28 # Start-of-Header 31 # Start-of-Header
29 name = "CxFreeze Plugin" 32 name = "CxFreeze Plugin"
38 """ CxFreeze is used to generate a distribution package.""" 41 """ CxFreeze is used to generate a distribution package."""
39 needsRestart = False 42 needsRestart = False
40 pyqtApi = 2 43 pyqtApi = 2
41 # End-of-Header 44 # End-of-Header
42 45
43 error = ""
44 exePy2 = [] 46 exePy2 = []
45 exePy3 = [] 47 exePy3 = []
46 48
47 def exeDisplayDataList(): 49 def exeDisplayDataList():
48 """ 50 """
196 198
197 @return flag indicating availability (boolean) 199 @return flag indicating availability (boolean)
198 """ 200 """
199 global error, exePy2, exePy3 201 global error, exePy2, exePy3
200 202
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
206 exePy2 = _findExecutable(2) 203 exePy2 = _findExecutable(2)
207 exePy3 = _findExecutable(3) 204 exePy3 = _findExecutable(3)
208 if (exePy2+exePy3) == []: 205 if (exePy2+exePy3) == []:
209 error = QCoreApplication.translate("CxFreezePlugin", 206 error = QCoreApplication.translate("CxFreezePlugin",
210 "The cxfreeze executable could not be found.") 207 "The cxfreeze executable could not be found.")
211 return False 208 return False
212 else: 209 else:
213 return True 210 return True
214 _checkProgram()
215 211
216 class CxFreezePlugin(QObject): 212 class CxFreezePlugin(QObject):
217 """ 213 """
218 Class implementing the CxFreeze plugin. 214 Class implementing the CxFreeze plugin.
219 """ 215 """
242 Public method to activate this plugin. 238 Public method to activate this plugin.
243 239
244 @return tuple of None and activation status (boolean) 240 @return tuple of None and activation status (boolean)
245 """ 241 """
246 global error 242 global error
243
244 # There is already an error, don't activate
245 if error:
246 return None, False
247 247
248 # cxfreeze is only activated if it is available 248 # cxfreeze is only activated if it is available
249 if not _checkProgram(): 249 if not _checkProgram():
250 return None, False 250 return None, False
251 251

eric ide

mercurial