scripts/install.py

changeset 7813
5d0dbec7b815
parent 7812
44004f273a7b
child 7814
6fa40642ed7c
equal deleted inserted replaced
7812:44004f273a7b 7813:5d0dbec7b815
54 macAppBundlePath = defaultMacAppBundlePath 54 macAppBundlePath = defaultMacAppBundlePath
55 macPythonExe = defaultMacPythonExe 55 macPythonExe = defaultMacPythonExe
56 56
57 installInfoName = "eric6install.json" 57 installInfoName = "eric6install.json"
58 installInfo = {} 58 installInfo = {}
59 installCwd = ""
59 60
60 # Define blacklisted versions of the prerequisites 61 # Define blacklisted versions of the prerequisites
61 BlackLists = { 62 BlackLists = {
62 "sip": [], 63 "sip": [],
63 "PyQt5": [], 64 "PyQt5": [],
1305 1306
1306 def createInstallInfo(): 1307 def createInstallInfo():
1307 """ 1308 """
1308 Record information about the way eric6 was installed. 1309 Record information about the way eric6 was installed.
1309 """ 1310 """
1310 global installInfo, cfg 1311 global installInfo, installCwd, cfg
1311 1312
1312 installDateTime = datetime.datetime.now(tz=None) 1313 installDateTime = datetime.datetime.now(tz=None)
1313 try: 1314 try:
1314 installInfo["sudo"] = os.getuid() == 0 1315 installInfo["sudo"] = os.getuid() == 0
1315 except AttributeError: 1316 except AttributeError:
1316 installInfo["sudo"] = False 1317 installInfo["sudo"] = False
1317 installInfo["user"] = os.getlogin() 1318 installInfo["user"] = os.getlogin()
1318 installInfo["exe"] = sys.executable 1319 installInfo["exe"] = sys.executable
1319 installInfo["argv"] = " ".join(shlex.quote(a) for a in sys.argv[:]) 1320 installInfo["argv"] = " ".join(shlex.quote(a) for a in sys.argv[:])
1320 installInfo["install_cwd"] = os.getcwd() 1321 installInfo["install_cwd"] = installCwd
1321 installInfo["eric"] = cfg["ericDir"] 1322 installInfo["eric"] = cfg["ericDir"]
1322 installInfo["virtualenv"] = installInfo["eric"].startswith( 1323 installInfo["virtualenv"] = installInfo["eric"].startswith(
1323 os.path.expanduser("~")) 1324 os.path.expanduser("~"))
1324 installInfo["installed"] = True 1325 installInfo["installed"] = True
1325 installInfo["installed_on"] = installDateTime.strftime( 1326 installInfo["installed_on"] = installDateTime.strftime(
1862 1863
1863 # Parse the command line. 1864 # Parse the command line.
1864 global progName, modDir, doCleanup, doCompile, distDir, cfg, apisDir 1865 global progName, modDir, doCleanup, doCompile, distDir, cfg, apisDir
1865 global sourceDir, eric6SourceDir, configName 1866 global sourceDir, eric6SourceDir, configName
1866 global macAppBundlePath, macAppBundleName, macPythonExe 1867 global macAppBundlePath, macAppBundleName, macPythonExe
1867 global installApis, doCleanDesktopLinks, yes2All 1868 global installApis, doCleanDesktopLinks, yes2All, installCwd
1868 1869
1869 if sys.version_info < (3, 5, 0) or sys.version_info > (3, 99, 99): 1870 if sys.version_info < (3, 5, 0) or sys.version_info > (3, 99, 99):
1870 print('Sorry, eric6 requires at least Python 3.5 for running.') 1871 print('Sorry, eric6 requires at least Python 3.5 for running.')
1871 exit(5) 1872 exit(5)
1872 1873
1873 progName = os.path.basename(argv[0]) 1874 progName = os.path.basename(argv[0])
1875
1876 installCwd = os.getcwd()
1874 1877
1875 if os.path.dirname(argv[0]): 1878 if os.path.dirname(argv[0]):
1876 os.chdir(os.path.dirname(argv[0])) 1879 os.chdir(os.path.dirname(argv[0]))
1877 1880
1878 initGlobals() 1881 initGlobals()

eric ide

mercurial