1705 else: |
1705 else: |
1706 filename = os.path.join(getConfig("ericDir"), "eric7installpip.json") |
1706 filename = os.path.join(getConfig("ericDir"), "eric7installpip.json") |
1707 if os.path.exists(filename): |
1707 if os.path.exists(filename): |
1708 # eric was installed via pip (i.e. eric-ide) |
1708 # eric was installed via pip (i.e. eric-ide) |
1709 with contextlib.suppress(OSError): |
1709 with contextlib.suppress(OSError): |
1710 installDateTime = datetime.datetime.now(tz=None) |
1710 installDateTime = datetime.datetime.now( |
|
1711 tz=datetime.timezone.utc |
|
1712 ) |
1711 with open(filename, "r") as infoFile: |
1713 with open(filename, "r") as infoFile: |
1712 installInfo = json.load(infoFile) |
1714 installInfo = json.load(infoFile) |
1713 installInfo["guessed"] = True |
1715 installInfo["guessed"] = True |
1714 installInfo["eric"] = getConfig("ericDir") |
1716 installInfo["eric"] = getConfig("ericDir") |
1715 installInfo["virtualenv"] = installInfo["eric"].startswith( |
1717 installInfo["virtualenv"] = installInfo["eric"].startswith( |
1766 if os.path.exists(filename) and os.path.getmtime( |
1768 if os.path.exists(filename) and os.path.getmtime( |
1767 filename |
1769 filename |
1768 ) > os.path.getmtime(installInfoFile): |
1770 ) > os.path.getmtime(installInfoFile): |
1769 # eric was updated via pip (i.e. eric-ide) |
1771 # eric was updated via pip (i.e. eric-ide) |
1770 # just update the installation date and time |
1772 # just update the installation date and time |
1771 installDateTime = datetime.datetime.now(tz=None) |
1773 installDateTime = datetime.datetime.now(tz=datetime.timezone.utc) |
1772 installInfo["installed_on"] = installDateTime.strftime( |
1774 installInfo["installed_on"] = installDateTime.strftime( |
1773 "%Y-%m-%d %H:%M:%S" |
1775 "%Y-%m-%d %H:%M:%S" |
1774 ) |
1776 ) |
1775 changed = True |
1777 changed = True |
1776 |
1778 |