371 f.write(text) |
371 f.write(text) |
372 f.close() |
372 f.close() |
373 os.chmod(dst, 0o644) |
373 os.chmod(dst, 0o644) |
374 |
374 |
375 |
375 |
376 def wrapperName(dname, wfile): |
376 def wrapperNames(dname, wfile): |
377 """ |
377 """ |
378 Create the platform specific name for the wrapper script. |
378 Create the platform specific names for the wrapper script. |
379 |
379 |
380 @param dname name of the directory to place the wrapper into |
380 @param dname name of the directory to place the wrapper into |
381 @param wfile basename (without extension) of the wrapper script |
381 @param wfile basename (without extension) of the wrapper script |
382 @return the name of the wrapper script |
382 @return the names of the wrapper scripts |
383 """ |
383 """ |
384 if sys.platform.startswith("win"): |
384 if sys.platform.startswith("win"): |
385 wname = dname + "\\" + wfile + ".bat" |
385 wnames = (dname + "\\" + wfile + ".cmd", |
386 else: |
386 dname + "\\" + wfile + ".bat") |
387 wname = dname + "/" + wfile |
387 else: |
388 |
388 wnames = (dname + "/" + wfile, ) |
389 return wname |
389 |
|
390 return wnames |
390 |
391 |
391 |
392 |
392 def createPyWrapper(pydir, wfile, isGuiScript=True): |
393 def createPyWrapper(pydir, wfile, isGuiScript=True): |
393 """ |
394 """ |
394 Create an executable wrapper for a Python script. |
395 Create an executable wrapper for a Python script. |
412 else: |
413 else: |
413 pyqt4opt = "" |
414 pyqt4opt = "" |
414 |
415 |
415 # all kinds of Windows systems |
416 # all kinds of Windows systems |
416 if sys.platform.startswith("win"): |
417 if sys.platform.startswith("win"): |
417 wname = wfile + marker + ".bat" |
418 wname = wfile + marker + ".cmd" |
418 if isGuiScript: |
419 if isGuiScript: |
419 wrapper = \ |
420 wrapper = \ |
420 '''@echo off\n''' \ |
421 '''@echo off\n''' \ |
421 '''start "" "{2}\\pythonw.exe"''' \ |
422 '''start "" "{2}\\pythonw.exe"''' \ |
422 ''' "{0}\\{1}.pyw"{3}''' \ |
423 ''' "{0}\\{1}.pyw"{3}''' \ |
643 dirs = [platBinDir, getConfig('bindir')] |
644 dirs = [platBinDir, getConfig('bindir')] |
644 if platBinDirOld: |
645 if platBinDirOld: |
645 dirs.append(platBinDirOld) |
646 dirs.append(platBinDirOld) |
646 for rem_wname in rem_wnames: |
647 for rem_wname in rem_wnames: |
647 for d in dirs: |
648 for d in dirs: |
648 rwname = wrapperName(d, rem_wname) |
649 for rwname in wrapperNames(d, rem_wname): |
649 if os.path.exists(rwname): |
650 if os.path.exists(rwname): |
650 os.remove(rwname) |
651 os.remove(rwname) |
651 |
652 |
652 # Cleanup our config file(s) |
653 # Cleanup our config file(s) |
653 for name in ['eric6config.py', 'eric6config.pyc', 'eric6.pth']: |
654 for name in ['eric6config.py', 'eric6config.pyc', 'eric6.pth']: |
654 e6cfile = os.path.join(pyModDir, name) |
655 e6cfile = os.path.join(pyModDir, name) |
655 if os.path.exists(e6cfile): |
656 if os.path.exists(e6cfile): |