src/eric7/UI/InstallInfoDialog.py

Fri, 04 Nov 2022 13:52:26 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Fri, 04 Nov 2022 13:52:26 +0100
branch
eric7
changeset 9473
3f23dbf37dbe
parent 9413
80c06d472826
child 9482
a2bc06a54d9d
permissions
-rw-r--r--

Resorted the import statements using isort.

7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
8881
54e42bc2437a Updated copyright for 2022.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8358
diff changeset
3 # Copyright (c) 2020 - 2022 Detlev Offenbach <detlev@die-offenbachs.de>
7809
f5a61d073100 Added information about the directory the installation was done from.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7808
diff changeset
4 #
f5a61d073100 Added information about the directory the installation was done from.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7808
diff changeset
5
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing a dialog to show information about the installation.
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
10 import json
7810
f8afd2238723 Install Info: extended the dialog by a delete action and an action to show upgrade instructions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7809
diff changeset
11 import os
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
12
8318
962bce857696 Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8312
diff changeset
13 from PyQt6.QtCore import pyqtSlot
962bce857696 Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8312
diff changeset
14 from PyQt6.QtWidgets import QDialog, QDialogButtonBox
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
15
9473
3f23dbf37dbe Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9413
diff changeset
16 from eric7 import Globals
3f23dbf37dbe Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9413
diff changeset
17 from eric7.EricGui import EricPixmapCache
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
18 from eric7.EricWidgets import EricMessageBox
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20 from .Ui_InstallInfoDialog import Ui_InstallInfoDialog
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23 class InstallInfoDialog(QDialog, Ui_InstallInfoDialog):
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24 """
7809
f5a61d073100 Added information about the directory the installation was done from.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7808
diff changeset
25 Class implementing a dialog to show information about the installation.
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26 """
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
27
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28 def __init__(self, parent=None):
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29 """
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 Constructor
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
31
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 @param parent reference to the parent widget
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33 @type QWidget
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34 """
8218
7c09585bd960 Applied some more code simplifications suggested by the new Simplify checker (super(Foo, self) => super()).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
35 super().__init__(parent)
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36 self.setupUi(self)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
37
7810
f8afd2238723 Install Info: extended the dialog by a delete action and an action to show upgrade instructions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7809
diff changeset
38 self.__deleteButton = self.buttonBox.addButton(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
39 self.tr("Delete Info"), QDialogButtonBox.ButtonRole.ActionRole
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
40 )
7810
f8afd2238723 Install Info: extended the dialog by a delete action and an action to show upgrade instructions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7809
diff changeset
41 self.__deleteButton.clicked.connect(self.on_deleteButton_clicked)
f8afd2238723 Install Info: extended the dialog by a delete action and an action to show upgrade instructions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7809
diff changeset
42 self.__updateButton = self.buttonBox.addButton(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
43 self.tr("Upgrade Instructions"), QDialogButtonBox.ButtonRole.ActionRole
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
44 )
7810
f8afd2238723 Install Info: extended the dialog by a delete action and an action to show upgrade instructions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7809
diff changeset
45 self.__updateButton.clicked.connect(self.on_updateButton_clicked)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
46
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
47 self.__edited = False
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
48 self.__loaded = True
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
49
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
50 self.editButton.setIcon(EricPixmapCache.getIcon("infoEdit"))
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
51 self.saveButton.setIcon(EricPixmapCache.getIcon("fileSave"))
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
52
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
53 infoFileName = Globals.getInstallInfoFilePath()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
54
7810
f8afd2238723 Install Info: extended the dialog by a delete action and an action to show upgrade instructions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7809
diff changeset
55 self.__deleteButton.setEnabled(os.path.exists(infoFileName))
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
56
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
57 try:
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
58 with open(infoFileName, "r") as infoFile:
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
59 self.__info = json.load(infoFile)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
60
7808
da107cd00f63 Install Information: added the installation date to the list of data.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7807
diff changeset
61 if Globals.isWindowsPlatform():
da107cd00f63 Install Information: added the installation date to the list of data.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7807
diff changeset
62 self.sudoLabel1.setText(self.tr("Installed as Administrator:"))
da107cd00f63 Install Information: added the installation date to the list of data.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7807
diff changeset
63 else:
da107cd00f63 Install Information: added the installation date to the list of data.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7807
diff changeset
64 self.sudoLabel1.setText(self.tr("Installed with sudo:"))
da107cd00f63 Install Information: added the installation date to the list of data.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7807
diff changeset
65 self.sudoLabel2.setText(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
66 self.tr("Yes") if self.__info["sudo"] else self.tr("No")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
67 )
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
68 self.userLabel.setText(self.__info["user"])
7809
f5a61d073100 Added information about the directory the installation was done from.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7808
diff changeset
69 self.installedFromEdit.setText(self.__info["install_cwd"])
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
70 self.interpreteEdit.setText(self.__info["exe"])
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
71 self.commandEdit.setText(self.__info["argv"])
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
72 self.installPathEdit.setText(self.__info["eric"])
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
73 self.virtenvLabel.setText(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
74 self.tr("Yes") if self.__info["virtualenv"] else self.tr("No")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
75 )
7809
f5a61d073100 Added information about the directory the installation was done from.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7808
diff changeset
76 self.remarksEdit.setPlainText(self.__info["remarks"])
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
77 if self.__info["pip"]:
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
78 self.pipLabel.setText(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
79 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
80 "'eric-ide' was installed from PyPI using the pip" " command."
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
81 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
82 )
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
83 else:
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
84 self.pipLabel.hide()
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
85 if self.__info["guessed"]:
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
86 self.guessLabel.setText(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
87 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
88 "The information shown in this dialog was guessed at"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
89 " the first start of eric."
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
90 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
91 )
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
92 else:
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
93 self.guessLabel.hide()
7809
f5a61d073100 Added information about the directory the installation was done from.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7808
diff changeset
94 if self.__info["edited"]:
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
95 self.userProvidedLabel.setText(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
96 self.tr("The installation information was provided by the user.")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
97 )
7808
da107cd00f63 Install Information: added the installation date to the list of data.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7807
diff changeset
98 else:
7809
f5a61d073100 Added information about the directory the installation was done from.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7808
diff changeset
99 self.userProvidedLabel.hide()
f5a61d073100 Added information about the directory the installation was done from.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7808
diff changeset
100 if self.__info["installed_on"]:
f5a61d073100 Added information about the directory the installation was done from.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7808
diff changeset
101 self.installDateTimeLabel.setText(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
102 self.__info["installed_on"]
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
103 if self.__info["installed_on"]
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
104 else self.tr("unknown")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
105 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
106
7810
f8afd2238723 Install Info: extended the dialog by a delete action and an action to show upgrade instructions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7809
diff changeset
107 self.__updateButton.setEnabled(bool(self.__info["exe"]))
7836
2f0d208b8137 Changed code to not use the OSError aliases (IOError, EnvironmentError, socket.error and select.error) anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7810
diff changeset
108 except OSError as err:
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8318
diff changeset
109 EricMessageBox.critical(
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
110 self,
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
111 self.tr("Load Install Information"),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
112 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
113 "<p>The file containing the install information could"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
114 " not be read.</p><p>Reason: {0}</p>"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
115 ""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
116 ).format(str(err)),
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
117 )
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
118 self.__loaded = False
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
119 self.__info = {}
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
120
7810
f8afd2238723 Install Info: extended the dialog by a delete action and an action to show upgrade instructions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7809
diff changeset
121 self.__updateButton.setEnabled(False)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
122
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
123 def wasLoaded(self):
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
124 """
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
125 Public method to check, if the install data was loaded.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
126
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
127 @return flag indicating the data was loaded
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
128 @rtype bool
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
129 """
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
130 return self.__loaded
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
131
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
132 @pyqtSlot(bool)
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
133 def on_editButton_toggled(self, checked):
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
134 """
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
135 Private slot to switch the dialog into edit mode.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
136
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
137 @param checked flag giving the button check state
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
138 @type bool
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
139 """
7809
f5a61d073100 Added information about the directory the installation was done from.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7808
diff changeset
140 self.installedFromEdit.setReadOnly(not checked)
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
141 self.interpreteEdit.setReadOnly(not checked)
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
142 self.commandEdit.setReadOnly(not checked)
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
143 self.installPathEdit.setReadOnly(not checked)
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
144 self.remarksEdit.setReadOnly(not checked)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
145
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
146 if checked:
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
147 self.__edited = True
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
148
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
149 @pyqtSlot()
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
150 def on_saveButton_clicked(self):
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
151 """
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
152 Private slot handling the save button press.
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
153 """
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
154 if self.__edited:
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
155 self.__saveData()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
156
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
157 @pyqtSlot()
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
158 def reject(self):
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
159 """
7809
f5a61d073100 Added information about the directory the installation was done from.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7808
diff changeset
160 Public slot handling the closing of the dialog.
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
161 """
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
162 if self.__edited:
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8318
diff changeset
163 yes = EricMessageBox.yesNo(
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
164 self,
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
165 self.tr("Install Information"),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
166 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
167 """The install information was edited. Unsaved"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
168 """ changes will be lost. Save first?"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
169 ),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
170 yesDefault=True,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
171 )
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
172 if yes:
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
173 self.__saveData()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
174
8218
7c09585bd960 Applied some more code simplifications suggested by the new Simplify checker (super(Foo, self) => super()).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
175 super().reject()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
176
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
177 def __saveData(self):
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
178 """
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
179 Private method to save the data.
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
180 """
7809
f5a61d073100 Added information about the directory the installation was done from.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7808
diff changeset
181 if self.installedFromEdit.text() != self.__info["install_cwd"]:
f5a61d073100 Added information about the directory the installation was done from.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7808
diff changeset
182 self.__info["install_cwd"] = self.installedFromEdit.text()
f5a61d073100 Added information about the directory the installation was done from.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7808
diff changeset
183 self.__info["install_cwd_edited"] = True
f5a61d073100 Added information about the directory the installation was done from.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7808
diff changeset
184 if self.interpreteEdit.text() != self.__info["exe"]:
f5a61d073100 Added information about the directory the installation was done from.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7808
diff changeset
185 self.__info["exe"] = self.interpreteEdit.text()
f5a61d073100 Added information about the directory the installation was done from.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7808
diff changeset
186 self.__info["exe_edited"] = True
f5a61d073100 Added information about the directory the installation was done from.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7808
diff changeset
187 if self.commandEdit.text() != self.__info["argv"]:
f5a61d073100 Added information about the directory the installation was done from.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7808
diff changeset
188 self.__info["argv"] = self.commandEdit.text()
f5a61d073100 Added information about the directory the installation was done from.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7808
diff changeset
189 self.__info["argv_edited"] = True
f5a61d073100 Added information about the directory the installation was done from.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7808
diff changeset
190 if self.installPathEdit.text() != self.__info["eric"]:
f5a61d073100 Added information about the directory the installation was done from.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7808
diff changeset
191 self.__info["eric"] = self.installPathEdit.text()
f5a61d073100 Added information about the directory the installation was done from.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7808
diff changeset
192 self.__info["eric_edited"] = True
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
193 self.__info["remarks"] = self.remarksEdit.toPlainText()
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
194 self.__info["edited"] = True
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
195
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
196 infoFileName = Globals.getInstallInfoFilePath()
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
197 try:
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
198 with open(infoFileName, "w") as infoFile:
7809
f5a61d073100 Added information about the directory the installation was done from.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7808
diff changeset
199 json.dump(self.__info, infoFile, indent=2)
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
200 self.__edited = False
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
201 self.editButton.setChecked(False)
7836
2f0d208b8137 Changed code to not use the OSError aliases (IOError, EnvironmentError, socket.error and select.error) anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7810
diff changeset
202 except OSError as err:
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8318
diff changeset
203 EricMessageBox.critical(
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
204 self,
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
205 self.tr("Save Install Information"),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
206 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
207 "<p>The file containing the install information could"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
208 " not be written.</p><p>Reason: {0}</p>"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
209 ""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
210 ).format(str(err)),
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
211 )
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
212
7810
f8afd2238723 Install Info: extended the dialog by a delete action and an action to show upgrade instructions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7809
diff changeset
213 @pyqtSlot()
f8afd2238723 Install Info: extended the dialog by a delete action and an action to show upgrade instructions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7809
diff changeset
214 def on_deleteButton_clicked(self):
f8afd2238723 Install Info: extended the dialog by a delete action and an action to show upgrade instructions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7809
diff changeset
215 """
f8afd2238723 Install Info: extended the dialog by a delete action and an action to show upgrade instructions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7809
diff changeset
216 Private slot deleting the install information file.
f8afd2238723 Install Info: extended the dialog by a delete action and an action to show upgrade instructions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7809
diff changeset
217 """
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8318
diff changeset
218 res = EricMessageBox.yesNo(
7810
f8afd2238723 Install Info: extended the dialog by a delete action and an action to show upgrade instructions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7809
diff changeset
219 self,
f8afd2238723 Install Info: extended the dialog by a delete action and an action to show upgrade instructions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7809
diff changeset
220 self.tr("Delete Installation Information"),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
221 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
222 """Do you really want to delete the installation"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
223 """ information? It will be recreated at the next"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
224 """ start."""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
225 ),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
226 )
7810
f8afd2238723 Install Info: extended the dialog by a delete action and an action to show upgrade instructions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7809
diff changeset
227 if not res:
f8afd2238723 Install Info: extended the dialog by a delete action and an action to show upgrade instructions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7809
diff changeset
228 return
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
229
7810
f8afd2238723 Install Info: extended the dialog by a delete action and an action to show upgrade instructions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7809
diff changeset
230 infoFileName = Globals.getInstallInfoFilePath()
f8afd2238723 Install Info: extended the dialog by a delete action and an action to show upgrade instructions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7809
diff changeset
231 os.remove(infoFileName)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
232
7810
f8afd2238723 Install Info: extended the dialog by a delete action and an action to show upgrade instructions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7809
diff changeset
233 # local data will be deleted automatically
f8afd2238723 Install Info: extended the dialog by a delete action and an action to show upgrade instructions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7809
diff changeset
234 self.__edited = False
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
235
7810
f8afd2238723 Install Info: extended the dialog by a delete action and an action to show upgrade instructions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7809
diff changeset
236 self.close()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
237
7810
f8afd2238723 Install Info: extended the dialog by a delete action and an action to show upgrade instructions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7809
diff changeset
238 @pyqtSlot()
f8afd2238723 Install Info: extended the dialog by a delete action and an action to show upgrade instructions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7809
diff changeset
239 def on_updateButton_clicked(self):
f8afd2238723 Install Info: extended the dialog by a delete action and an action to show upgrade instructions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7809
diff changeset
240 """
f8afd2238723 Install Info: extended the dialog by a delete action and an action to show upgrade instructions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7809
diff changeset
241 Private slot to show some upgrade instructions.
f8afd2238723 Install Info: extended the dialog by a delete action and an action to show upgrade instructions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7809
diff changeset
242 """
f8afd2238723 Install Info: extended the dialog by a delete action and an action to show upgrade instructions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7809
diff changeset
243 updateTextList = []
f8afd2238723 Install Info: extended the dialog by a delete action and an action to show upgrade instructions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7809
diff changeset
244 cmdPrefix = ""
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
245
7810
f8afd2238723 Install Info: extended the dialog by a delete action and an action to show upgrade instructions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7809
diff changeset
246 if self.__info["sudo"]:
f8afd2238723 Install Info: extended the dialog by a delete action and an action to show upgrade instructions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7809
diff changeset
247 if Globals.isWindowsPlatform():
f8afd2238723 Install Info: extended the dialog by a delete action and an action to show upgrade instructions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7809
diff changeset
248 updateTextList.append(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
249 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
250 "Perform the following step(s) with Administrator"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
251 " privileges.\n"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
252 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
253 )
7810
f8afd2238723 Install Info: extended the dialog by a delete action and an action to show upgrade instructions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7809
diff changeset
254 else:
f8afd2238723 Install Info: extended the dialog by a delete action and an action to show upgrade instructions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7809
diff changeset
255 cmdPrefix = "sudo "
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
256
7810
f8afd2238723 Install Info: extended the dialog by a delete action and an action to show upgrade instructions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7809
diff changeset
257 if self.__info["pip"]:
f8afd2238723 Install Info: extended the dialog by a delete action and an action to show upgrade instructions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7809
diff changeset
258 updateTextList.append(
f8afd2238723 Install Info: extended the dialog by a delete action and an action to show upgrade instructions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7809
diff changeset
259 "{0}{1} -m pip install --upgrade eric-ide".format(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
260 cmdPrefix,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
261 self.__info["exe"],
7810
f8afd2238723 Install Info: extended the dialog by a delete action and an action to show upgrade instructions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7809
diff changeset
262 )
f8afd2238723 Install Info: extended the dialog by a delete action and an action to show upgrade instructions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7809
diff changeset
263 )
f8afd2238723 Install Info: extended the dialog by a delete action and an action to show upgrade instructions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7809
diff changeset
264 else:
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
265 if "install_cwd" in self.__info and bool(self.__info["install_cwd"]):
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
266 updateTextList.append("cd {0}".format(self.__info["install_cwd"]))
7810
f8afd2238723 Install Info: extended the dialog by a delete action and an action to show upgrade instructions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7809
diff changeset
267 updateTextList.append(
f8afd2238723 Install Info: extended the dialog by a delete action and an action to show upgrade instructions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7809
diff changeset
268 "{0}{1} {2}".format(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
269 cmdPrefix,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
270 self.__info["exe"],
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
271 self.__info["argv"],
7810
f8afd2238723 Install Info: extended the dialog by a delete action and an action to show upgrade instructions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7809
diff changeset
272 )
f8afd2238723 Install Info: extended the dialog by a delete action and an action to show upgrade instructions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7809
diff changeset
273 )
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
274
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
275 from eric7.EricWidgets.EricPlainTextDialog import EricPlainTextDialog
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
276
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8318
diff changeset
277 dlg = EricPlainTextDialog(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
278 title=self.tr("Upgrade Instructions"), text="\n".join(updateTextList)
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
279 )
7810
f8afd2238723 Install Info: extended the dialog by a delete action and an action to show upgrade instructions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7809
diff changeset
280 dlg.exec()

eric ide

mercurial