28 # Start-of-Header |
28 # Start-of-Header |
29 name = "CxFreeze Plugin" |
29 name = "CxFreeze Plugin" |
30 author = "Detlev Offenbach <detlev@die-offenbachs.de>" |
30 author = "Detlev Offenbach <detlev@die-offenbachs.de>" |
31 autoactivate = True |
31 autoactivate = True |
32 deactivateable = True |
32 deactivateable = True |
33 version = "6.0.13" |
33 version = "6.1.0" |
34 className = "CxFreezePlugin" |
34 className = "CxFreezePlugin" |
35 packageName = "CxFreeze" |
35 packageName = "CxFreeze" |
36 shortDescription = "Show the CxFreeze dialogs." |
36 shortDescription = "Show the CxFreeze dialogs." |
37 longDescription = \ |
37 longDescription = ( |
38 """This plugin implements the CxFreeze dialogs.""" \ |
38 """This plugin implements the CxFreeze dialogs.""" |
39 """ CxFreeze is used to generate a distribution package.""" |
39 """ CxFreeze is used to generate a distribution package.""" |
|
40 ) |
40 needsRestart = False |
41 needsRestart = False |
41 pyqtApi = 2 |
42 pyqtApi = 2 |
42 python2Compatible = True |
43 python2Compatible = True |
43 # End-of-Header |
44 # End-of-Header |
44 |
45 |
145 exePath = getExePath( |
146 exePath = getExePath( |
146 winreg.HKEY_LOCAL_MACHINE, |
147 winreg.HKEY_LOCAL_MACHINE, |
147 winreg.KEY_WOW64_64KEY | winreg.KEY_READ, versionStr) |
148 winreg.KEY_WOW64_64KEY | winreg.KEY_READ, versionStr) |
148 if exePath is not None: |
149 if exePath is not None: |
149 executables.add(exePath) |
150 executables.add(exePath) |
|
151 |
|
152 if not executables and majorVersion >= 3: |
|
153 # check the PATH environment variable if nothing was found |
|
154 # Python 3 only |
|
155 path = Utilities.getEnvironmentEntry('PATH') |
|
156 if path: |
|
157 dirs = path.split(os.pathsep) |
|
158 for directory in dirs: |
|
159 for suffix in (".bat", ".exe"): |
|
160 exe = os.path.join(directory, "cxfreeze" + suffix) |
|
161 if os.access(exe, os.X_OK): |
|
162 executables.add(exe) |
150 else: |
163 else: |
151 # |
164 # |
152 # Linux, Unix ... |
165 # Linux, Unix ... |
153 cxfreezeScript = 'cxfreeze' |
166 cxfreezeScript = 'cxfreeze' |
154 scriptSuffixes = ["", "-python{0}".format(majorVersion)] |
167 scriptSuffixes = ["", "-python{0}".format(majorVersion)] |
326 Private method to load the translation file. |
339 Private method to load the translation file. |
327 """ |
340 """ |
328 if self.__ui is not None: |
341 if self.__ui is not None: |
329 loc = self.__ui.getLocale() |
342 loc = self.__ui.getLocale() |
330 if loc and loc != "C": |
343 if loc and loc != "C": |
331 locale_dir = \ |
344 locale_dir = os.path.join(os.path.dirname(__file__), |
332 os.path.join(os.path.dirname(__file__), "CxFreeze", "i18n") |
345 "CxFreeze", "i18n") |
333 translation = "cxfreeze_{0}".format(loc) |
346 translation = "cxfreeze_{0}".format(loc) |
334 translator = QTranslator(None) |
347 translator = QTranslator(None) |
335 loaded = translator.load(translation, locale_dir) |
348 loaded = translator.load(translation, locale_dir) |
336 if loaded: |
349 if loaded: |
337 self.__translator = translator |
350 self.__translator = translator |
356 """ project."""), |
369 """ project."""), |
357 E5MessageBox.StandardButtons(E5MessageBox.Abort)) |
370 E5MessageBox.StandardButtons(E5MessageBox.Abort)) |
358 return |
371 return |
359 |
372 |
360 majorVersionStr = project.getProjectLanguage() |
373 majorVersionStr = project.getProjectLanguage() |
361 exe = {"Python": exePy2, "Python2": exePy2, "Python3": exePy3}\ |
374 exe = {"Python": exePy2, |
362 .get(majorVersionStr) |
375 "Python2": exePy2, |
|
376 "Python3": exePy3}.get(majorVersionStr) |
363 if exe == []: |
377 if exe == []: |
364 E5MessageBox.critical( |
378 E5MessageBox.critical( |
365 self.__ui, |
379 self.__ui, |
366 self.tr("cxfreeze"), |
380 self.tr("cxfreeze"), |
367 self.tr("""The cxfreeze executable could not be found.""")) |
381 self.tr("""The cxfreeze executable could not be found.""")) |