install.py

changeset 904
0e938fc74f84
parent 903
0708b617a658
child 908
d00447340771
child 1116
ba7dd484ce98
equal deleted inserted replaced
903:0708b617a658 904:0e938fc74f84
30 doCompile = True 30 doCompile = True
31 cfg = {} 31 cfg = {}
32 progLanguages = ["Python", "Ruby"] 32 progLanguages = ["Python", "Ruby"]
33 sourceDir = "eric" 33 sourceDir = "eric"
34 configName = 'eric5config.py' 34 configName = 'eric5config.py'
35 useStart = True
36 35
37 # Define blacklisted versions of the prerequisites 36 # Define blacklisted versions of the prerequisites
38 BlackLists = { 37 BlackLists = {
39 "sip" : ["4.11"], 38 "sip" : ["4.11"],
40 "PyQt4" : ["4.7.5"], 39 "PyQt4" : ["4.7.5"],
78 print(" -i dir temporary install prefix") 77 print(" -i dir temporary install prefix")
79 print(" (default: {0})".format(distDir)) 78 print(" (default: {0})".format(distDir))
80 print(" -x don't perform dependency checks (use on your own risk)") 79 print(" -x don't perform dependency checks (use on your own risk)")
81 print(" -c don't cleanup old installation first") 80 print(" -c don't cleanup old installation first")
82 print(" -z don't compile the installed python files") 81 print(" -z don't compile the installed python files")
83 print(" -s don't use the 'start' variant of the Windows batch script")
84 print() 82 print()
85 print("The file given to the -f option must be valid Python code defining a") 83 print("The file given to the -f option must be valid Python code defining a")
86 print("dictionary called 'cfg' with the keys 'ericDir', 'ericPixDir', 'ericIconDir',") 84 print("dictionary called 'cfg' with the keys 'ericDir', 'ericPixDir', 'ericIconDir',")
87 print("'ericDTDDir', 'ericCSSDir', 'ericStylesDir', 'ericDocDir', 'ericExamplesDir',") 85 print("'ericDTDDir', 'ericCSSDir', 'ericStylesDir', 'ericDocDir', 'ericExamplesDir',")
88 print("'ericTranslationsDir', 'ericTemplatesDir', 'ericCodeTemplatesDir',") 86 print("'ericTranslationsDir', 'ericTemplatesDir', 'ericCodeTemplatesDir',")
162 @param wfile the basename of the wrapper 160 @param wfile the basename of the wrapper
163 @param isGuiScript flag indicating a wrapper script for a GUI 161 @param isGuiScript flag indicating a wrapper script for a GUI
164 application (boolean) 162 application (boolean)
165 @return the platform specific name of the wrapper 163 @return the platform specific name of the wrapper
166 """ 164 """
167 global useStart
168
169 # all kinds of Windows systems 165 # all kinds of Windows systems
170 if sys.platform.startswith("win"): 166 if sys.platform.startswith("win"):
171 wname = wfile + ".bat" 167 wname = wfile + ".bat"
172 if isGuiScript: 168 if isGuiScript:
173 if useStart:
174 start = "start "
175 else:
176 start = ""
177 wrapper = \ 169 wrapper = \
178 '''@echo off\r\n''' \ 170 '''@echo off\r\n''' \
179 '''set PYDIR=%~dp0\r\n''' \ 171 '''set PYDIR=%~dp0\r\n''' \
180 '''{0}"%PYDIR%\\pythonw.exe"''' \ 172 '''start "" "%PYDIR%\\pythonw.exe"''' \
181 ''' "%PYDIR%\\Lib\\site-packages\\eric5\\{1}.pyw"''' \ 173 ''' "%PYDIR%\\Lib\\site-packages\\eric5\\{0}.pyw"''' \
182 ''' %1 %2 %3 %4 %5 %6 %7 %8 %9\r\n'''.format( 174 ''' %1 %2 %3 %4 %5 %6 %7 %8 %9\r\n'''.format(wfile)
183 start, wfile)
184 else: 175 else:
185 wrapper = \ 176 wrapper = \
186 '''@"{0}\\python" "{1}\\{2}.py"''' \ 177 '''@"{0}\\python" "{1}\\{2}.py"''' \
187 ''' %1 %2 %3 %4 %5 %6 %7 %8 %9\r\n'''.format( 178 ''' %1 %2 %3 %4 %5 %6 %7 %8 %9\r\n'''.format(
188 platBinDir, pydir, wfile) 179 platBinDir, pydir, wfile)
795 """ 786 """
796 import getopt 787 import getopt
797 788
798 # Parse the command line. 789 # Parse the command line.
799 global progName, modDir, doCleanup, doCompile, distDir, cfg, apisDir 790 global progName, modDir, doCleanup, doCompile, distDir, cfg, apisDir
800 global sourceDir, configName, useStart 791 global sourceDir, configName
801 792
802 progName = os.path.basename(argv[0]) 793 progName = os.path.basename(argv[0])
803 794
804 initGlobals() 795 initGlobals()
805 796
839 print("The configuration dictionary in '{0}' is incorrect. Aborting"\ 830 print("The configuration dictionary in '{0}' is incorrect. Aborting"\
840 .format(arg)) 831 .format(arg))
841 exit(6) 832 exit(6)
842 except: 833 except:
843 cfg = {} 834 cfg = {}
844 elif opt == "-s":
845 useStart = False
846 835
847 installFromSource = not os.path.isdir(sourceDir) 836 installFromSource = not os.path.isdir(sourceDir)
848 if installFromSource: 837 if installFromSource:
849 sourceDir = os.path.dirname(__file__) or "." 838 sourceDir = os.path.dirname(__file__) or "."
850 configName = os.path.join(sourceDir, "eric5config.py") 839 configName = os.path.join(sourceDir, "eric5config.py")

eric ide

mercurial