eric6/UI/UserInterface.py

changeset 7813
5d0dbec7b815
parent 7809
f5a61d073100
child 7814
6fa40642ed7c
equal deleted inserted replaced
7812:44004f273a7b 7813:5d0dbec7b815
1515 if "installed_on" not in installInfo: 1515 if "installed_on" not in installInfo:
1516 installInfo["installed_on"] = "" 1516 installInfo["installed_on"] = ""
1517 changed = True 1517 changed = True
1518 1518
1519 # 2. merge new data into stored file 1519 # 2. merge new data into stored file
1520 # TODO: merge new data into info file stored in .eric 1520 filename = os.path.join(getConfig("ericDir"), "eric6install.json")
1521 if os.path.exists(filename):
1522 # eric was updated via the install.py script
1523 if (
1524 os.path.getmtime(filename) >
1525 os.path.getmtime(installInfoFile)
1526 ):
1527 if not installInfo["edited"]:
1528 shutil.copy2(filename, installInfoFile)
1529 else:
1530 with open(filename, "r") as infoFile:
1531 installInfo2 = json.load(infoFile)
1532 if not installInfo["install_cwd_edited"]:
1533 installInfo2["install_cwd"] = installInfo[
1534 "install_cwd"]
1535 if not installInfo["exe_edited"]:
1536 installInfo2["exe"] = installInfo["exe"]
1537 if not installInfo["argv_edited"]:
1538 installInfo2["argv"] = installInfo["argv"]
1539 if not installInfo["eric_edited"]:
1540 installInfo2["eric"] = installInfo["eric"]
1541 installInfo = installInfo2
1542 changed = True
1543 else:
1544 filename = os.path.join(getConfig("ericDir"),
1545 "eric6installpip.json")
1546 if os.path.exists(filename):
1547 # eric was updated via pip (i.e. eric-ide)
1548 # just update the installation date and time
1549 installDateTime = datetime.datetime.now(tz=None)
1550 installInfo["installed_on"] = installDateTime.strftime(
1551 "%Y-%m-%d %H:%M:%S")
1552 changed = True
1553
1521 if changed: 1554 if changed:
1522 with open(installInfoFile, "w") as infoFile: 1555 with open(installInfoFile, "w") as infoFile:
1523 json.dump(installInfo, infoFile, indent=2) 1556 json.dump(installInfo, infoFile, indent=2)
1524 1557
1525 def __createDockWindow(self, name): 1558 def __createDockWindow(self, name):

eric ide

mercurial