149 wname = dname + "/" + wfile |
149 wname = dname + "/" + wfile |
150 |
150 |
151 return wname |
151 return wname |
152 |
152 |
153 |
153 |
154 def createPyWrapper(pydir, wfile): |
154 def createPyWrapper(pydir, wfile, isGuiScript = True): |
155 """ |
155 """ |
156 Create an executable wrapper for a Python script. |
156 Create an executable wrapper for a Python script. |
157 |
157 |
158 @param pydir the name of the directory where the Python script will eventually |
158 @param pydir the name of the directory where the Python script will |
159 be installed |
159 eventually be installed |
160 @param wfile the basename of the wrapper |
160 @param wfile the basename of the wrapper |
161 @return the platform specific name of the wrapper |
161 @return the platform specific name of the wrapper |
162 """ |
162 """ |
163 # all kinds of Windows systems |
163 # all kinds of Windows systems |
164 if sys.platform.startswith("win"): |
164 if sys.platform.startswith("win"): |
165 wname = wfile + ".bat" |
165 wname = wfile + ".bat" |
|
166 if isGuiScript: |
|
167 ext = "pyw" |
|
168 else: |
|
169 ext = "py" |
166 wrapper = \ |
170 wrapper = \ |
167 '''@echo off\r\n''' \ |
171 '''@echo off\r\n''' \ |
168 '''set PYDIR=%~dp0\r\n''' \ |
172 '''set PYDIR=%~dp0\r\n''' \ |
169 '''start "%PYDIR%\\pythonw.exe"''' \ |
173 '''start "%PYDIR%\\pythonw.exe"''' \ |
170 ''' "%PYDIR%\\Lib\\site-packages\\eric5\\{0}.pyw"''' \ |
174 ''' "%PYDIR%\\Lib\\site-packages\\eric5\\{0}.{1}"''' \ |
171 ''' %1 %2 %3 %4 %5 %6 %7 %8 %9\r\n'''.format(wfile) |
175 ''' %1 %2 %3 %4 %5 %6 %7 %8 %9\r\n'''.format(wfile, ext) |
172 |
176 |
173 # Mac OS X |
177 # Mac OS X |
174 elif sys.platform == "darwin": |
178 elif sys.platform == "darwin": |
175 wname = wfile |
179 wname = wfile |
176 wrapper = \ |
180 wrapper = \ |
329 """ |
333 """ |
330 global distDir, doCleanup, cfg, progLanguages, sourceDir, configName |
334 global distDir, doCleanup, cfg, progLanguages, sourceDir, configName |
331 |
335 |
332 # Create the platform specific wrappers. |
336 # Create the platform specific wrappers. |
333 wnames = [] |
337 wnames = [] |
334 wnames.append(createPyWrapper(cfg['ericDir'], "eric5-api")) |
338 wnames.append(createPyWrapper(cfg['ericDir'], "eric5-api", False)) |
335 wnames.append(createPyWrapper(cfg['ericDir'], "eric5_compare")) |
339 wnames.append(createPyWrapper(cfg['ericDir'], "eric5_compare")) |
336 wnames.append(createPyWrapper(cfg['ericDir'], "eric5_configure")) |
340 wnames.append(createPyWrapper(cfg['ericDir'], "eric5_configure")) |
337 wnames.append(createPyWrapper(cfg['ericDir'], "eric5_diff")) |
341 wnames.append(createPyWrapper(cfg['ericDir'], "eric5_diff")) |
338 wnames.append(createPyWrapper(cfg['ericDir'], "eric5-doc")) |
342 wnames.append(createPyWrapper(cfg['ericDir'], "eric5-doc", False)) |
339 wnames.append(createPyWrapper(cfg['ericDir'], "eric5_editor")) |
343 wnames.append(createPyWrapper(cfg['ericDir'], "eric5_editor")) |
340 wnames.append(createPyWrapper(cfg['ericDir'], "eric5_iconeditor")) |
344 wnames.append(createPyWrapper(cfg['ericDir'], "eric5_iconeditor")) |
341 wnames.append(createPyWrapper(cfg['ericDir'], "eric5_plugininstall")) |
345 wnames.append(createPyWrapper(cfg['ericDir'], "eric5_plugininstall")) |
342 wnames.append(createPyWrapper(cfg['ericDir'], "eric5_pluginrepository")) |
346 wnames.append(createPyWrapper(cfg['ericDir'], "eric5_pluginrepository")) |
343 wnames.append(createPyWrapper(cfg['ericDir'], "eric5_pluginuninstall")) |
347 wnames.append(createPyWrapper(cfg['ericDir'], "eric5_pluginuninstall")) |