scripts/install.py

changeset 7807
5514ca6a62ca
parent 7806
b346755b09a1
child 7809
f5a61d073100
equal deleted inserted replaced
7806:b346755b09a1 7807:5514ca6a62ca
20 import subprocess # secok 20 import subprocess # secok
21 import time 21 import time
22 import io 22 import io
23 import json 23 import json
24 import shlex 24 import shlex
25 import datetime
25 26
26 # Define the globals. 27 # Define the globals.
27 progName = None 28 progName = None
28 currDir = os.getcwd() 29 currDir = os.getcwd()
29 modDir = None 30 modDir = None
1306 """ 1307 """
1307 Record information about the way eric6 was installed. 1308 Record information about the way eric6 was installed.
1308 """ 1309 """
1309 global installInfo, cfg 1310 global installInfo, cfg
1310 1311
1312 installDateTime = datetime.datetime.now(tz=None)
1311 try: 1313 try:
1312 installInfo["sudo"] = os.getuid() == 0 1314 installInfo["sudo"] = os.getuid() == 0
1313 except AttributeError: 1315 except AttributeError:
1314 installInfo["sudo"] = False 1316 installInfo["sudo"] = False
1315 installInfo["user"] = os.getlogin() 1317 installInfo["user"] = os.getlogin()
1317 installInfo["argv"] = " ".join(shlex.quote(a) for a in sys.argv[:]) 1319 installInfo["argv"] = " ".join(shlex.quote(a) for a in sys.argv[:])
1318 installInfo["eric"] = cfg["ericDir"] 1320 installInfo["eric"] = cfg["ericDir"]
1319 installInfo["virtualenv"] = installInfo["eric"].startswith( 1321 installInfo["virtualenv"] = installInfo["eric"].startswith(
1320 os.path.expanduser("~")) 1322 os.path.expanduser("~"))
1321 installInfo["installed"] = True 1323 installInfo["installed"] = True
1324 installInfo["installed_on"] = installDateTime.strftime(
1325 "%Y-%m-%d %H:%M:%S")
1322 installInfo["guessed"] = False 1326 installInfo["guessed"] = False
1323 installInfo["edited"] = False 1327 installInfo["edited"] = False
1324 installInfo["pip"] = False 1328 installInfo["pip"] = False
1325 installInfo["remarks"] = "" 1329 installInfo["remarks"] = ""
1326 1330 installInfo["exe_edited"] = False
1331 installInfo["argv_edited"] = False
1332 installInfo["eric_edited"] = False
1333 # TODO: add current path (os.getcwd())
1327 1334
1328 def pipInstall(packageName, message): 1335 def pipInstall(packageName, message):
1329 """ 1336 """
1330 Install the given package via pip. 1337 Install the given package via pip.
1331 1338

eric ide

mercurial