src/eric7/UI/InstallInfoDialog.py

Tue, 06 Dec 2022 17:35:41 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 06 Dec 2022 17:35:41 +0100
branch
eric7
changeset 9576
be9f8e7e42e0
parent 9482
a2bc06a54d9d
child 9624
b47dfa7a137d
permissions
-rw-r--r--

Corrected some 'wrong' string quotes caused by the Black line merging.

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
9482
a2bc06a54d9d Corrected/acknowledged some bad import style and removed some obsolete code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9473
diff changeset
19 from eric7.EricWidgets.EricPlainTextDialog import EricPlainTextDialog
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21 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
22
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24 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
25 """
7809
f5a61d073100 Added information about the directory the installation was done from.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7808
diff changeset
26 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
27 """
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
28
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29 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
30 """
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31 Constructor
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
32
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33 @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
34 @type QWidget
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
35 """
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
36 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
37 self.setupUi(self)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
38
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
39 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
40 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
41 )
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
42 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
43 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
44 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
45 )
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
46 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
47
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
48 self.__edited = False
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
49 self.__loaded = True
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
50
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
51 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
52 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
53
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
54 infoFileName = Globals.getInstallInfoFilePath()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
55
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
56 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
57
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
58 try:
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
59 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
60 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
61
7808
da107cd00f63 Install Information: added the installation date to the list of data.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7807
diff changeset
62 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
63 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
64 else:
da107cd00f63 Install Information: added the installation date to the list of data.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7807
diff changeset
65 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
66 self.sudoLabel2.setText(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
67 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
68 )
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
69 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
70 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
71 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
72 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
73 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
74 self.virtenvLabel.setText(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
75 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
76 )
7809
f5a61d073100 Added information about the directory the installation was done from.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7808
diff changeset
77 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
78 if self.__info["pip"]:
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
79 self.pipLabel.setText(
9576
be9f8e7e42e0 Corrected some 'wrong' string quotes caused by the Black line merging.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9482
diff changeset
80 self.tr("'eric-ide' was installed from PyPI using the pip command.")
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
81 )
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
82 else:
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
83 self.pipLabel.hide()
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
84 if self.__info["guessed"]:
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
85 self.guessLabel.setText(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
86 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
87 "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
88 " the first start of eric."
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
89 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
90 )
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
91 else:
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
92 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
93 if self.__info["edited"]:
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
94 self.userProvidedLabel.setText(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
95 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
96 )
7808
da107cd00f63 Install Information: added the installation date to the list of data.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7807
diff changeset
97 else:
7809
f5a61d073100 Added information about the directory the installation was done from.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7808
diff changeset
98 self.userProvidedLabel.hide()
f5a61d073100 Added information about the directory the installation was done from.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7808
diff changeset
99 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
100 self.installDateTimeLabel.setText(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
101 self.__info["installed_on"]
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
102 if self.__info["installed_on"]
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
103 else self.tr("unknown")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
104 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
105
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
106 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
107 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
108 EricMessageBox.critical(
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
109 self,
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
110 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
111 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
112 "<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
113 " 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
114 ""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
115 ).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
116 )
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
117 self.__loaded = False
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
118 self.__info = {}
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
119
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
120 self.__updateButton.setEnabled(False)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
121
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
122 def wasLoaded(self):
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
123 """
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
124 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
125
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
126 @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
127 @rtype bool
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
128 """
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
129 return self.__loaded
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
130
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
131 @pyqtSlot(bool)
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
132 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
133 """
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
134 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
135
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
136 @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
137 @type bool
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
138 """
7809
f5a61d073100 Added information about the directory the installation was done from.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7808
diff changeset
139 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
140 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
141 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
142 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
143 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
144
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
145 if checked:
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
146 self.__edited = True
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
147
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
148 @pyqtSlot()
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
149 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
150 """
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
151 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
152 """
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
153 if self.__edited:
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
154 self.__saveData()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
155
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
156 @pyqtSlot()
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
157 def reject(self):
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
158 """
7809
f5a61d073100 Added information about the directory the installation was done from.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7808
diff changeset
159 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
160 """
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
161 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
162 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
163 self,
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
164 self.tr("Install Information"),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
165 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
166 """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
167 """ 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
168 ),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
169 yesDefault=True,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
170 )
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
171 if yes:
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
172 self.__saveData()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
173
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
174 super().reject()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
175
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
176 def __saveData(self):
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
177 """
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
178 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
179 """
7809
f5a61d073100 Added information about the directory the installation was done from.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7808
diff changeset
180 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
181 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
182 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
183 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
184 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
185 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
186 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
187 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
188 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
189 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
190 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
191 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
192 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
193 self.__info["edited"] = True
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
194
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
195 infoFileName = Globals.getInstallInfoFilePath()
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
196 try:
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
197 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
198 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
199 self.__edited = False
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
200 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
201 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
202 EricMessageBox.critical(
7806
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
203 self,
b346755b09a1 Main Window: added a dialog showing information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
204 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
205 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
206 "<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
207 " 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
208 ""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
209 ).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
210 )
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
211
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
212 @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
213 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
214 """
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 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
216 """
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
217 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
218 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
219 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
220 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
221 """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
222 """ 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
223 """ start."""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
224 ),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
225 )
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
226 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
227 return
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
228
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
229 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
230 os.remove(infoFileName)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
231
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
232 # 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
233 self.__edited = False
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
234
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
235 self.close()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
236
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
237 @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
238 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
239 """
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 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
241 """
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 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
243 cmdPrefix = ""
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
244
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
245 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
246 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
247 updateTextList.append(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
248 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
249 "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
250 " privileges.\n"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
251 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
252 )
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
253 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
254 cmdPrefix = "sudo "
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
255
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
256 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
257 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
258 "{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
259 cmdPrefix,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
260 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
261 )
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 else:
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
264 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
265 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
266 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
267 "{0}{1} {2}".format(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
268 cmdPrefix,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
269 self.__info["exe"],
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
270 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
271 )
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 )
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
273
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
274 dlg = EricPlainTextDialog(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
275 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
276 )
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
277 dlg.exec()

eric ide

mercurial