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 |