CondaInterface/CondaExecDialog.py

Thu, 07 Feb 2019 18:54:38 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 07 Feb 2019 18:54:38 +0100
branch
conda
changeset 6706
d792e054cde2
parent 6697
2f5c951bdf14
child 6714
7718e9b548fa
permissions
-rw-r--r--

Conda, CondaPackagesWidget: continued implementing list functionality.

6677
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3 # Copyright (c) 2019 Detlev Offenbach <detlev@die-offenbachs.de>
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing a dialog to show the output of a conda execution.
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
10 from __future__ import unicode_literals
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
11 try:
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
12 str = unicode
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
13 except NameError:
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
14 pass
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
15
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
16 import json
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18 from PyQt5.QtCore import pyqtSlot, QProcess, QTimer
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19 from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QAbstractButton
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21 from E5Gui import E5MessageBox
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23 from .Ui_CondaExecDialog import Ui_CondaExecDialog
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 import Preferences
6697
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6685
diff changeset
26 import Globals
6677
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29 class CondaExecDialog(QDialog, Ui_CondaExecDialog):
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 """
6678
5f1de9e59227 Fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6677
diff changeset
31 Class implementing a dialog to show the output of a conda execution.
6677
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 """
6697
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6685
diff changeset
33 def __init__(self, command, parent=None):
6677
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34 """
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
35 Constructor
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36
6697
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6685
diff changeset
37 @param command conda command executed
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6685
diff changeset
38 @type str
6677
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
39 @param parent reference to the parent widget
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
40 @type QWidget
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
41 """
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
42 super(CondaExecDialog, self).__init__(parent)
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
43 self.setupUi(self)
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44
6697
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6685
diff changeset
45 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False)
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6685
diff changeset
46 self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True)
6685
fbaee9890715 CondaExecDialog: did some cleanup and streamlining.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6683
diff changeset
47
6697
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6685
diff changeset
48 self.__condaCommand = command
6677
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
49
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
50 self.__process = None
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
51 self.__condaExe = Preferences.getConda("CondaExecutable")
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
52 if not self.__condaExe:
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
53 self.__condaExe = "conda"
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
54
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
55 @pyqtSlot(QAbstractButton)
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
56 def on_buttonBox_clicked(self, button):
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
57 """
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
58 Private slot called by a button of the button box clicked.
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
59
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
60 @param button button that was clicked
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
61 @type QAbstractButton
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
62 """
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
63 if button == self.buttonBox.button(QDialogButtonBox.Close):
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
64 self.accept()
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
65 elif button == self.buttonBox.button(QDialogButtonBox.Cancel):
6679
c5f7b2e9a06d CondaExecDialog: fixed abug calling the finish method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6678
diff changeset
66 self.__finish(1, 0)
6677
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
67
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
68 def start(self, arguments):
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
69 """
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
70 Public slot to start the conda command.
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
71
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
72 @param arguments commandline arguments for conda program
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
73 @type list of str
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
74 """
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
75 self.errorGroup.hide()
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
76 self.progressLabel.hide()
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
77 self.progressBar.hide()
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
78
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
79 self.contents.clear()
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
80 self.errors.clear()
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
81 self.progressLabel.clear()
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
82 self.progressBar.setValue(0)
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
83
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
84 self.__bufferedStdout = None
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
85 self.__json = "--json" in arguments
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
86 self.__firstProgress = True
6683
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
87 self.__lastFetchFile = ""
6677
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
88
6697
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6685
diff changeset
89 self.__statusOk = False
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6685
diff changeset
90 self.__result = None
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6685
diff changeset
91
6706
d792e054cde2 Conda, CondaPackagesWidget: continued implementing list functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6697
diff changeset
92 self.__logOutput(self.__condaExe + " " + " ".join(arguments) + "\n\n")
d792e054cde2 Conda, CondaPackagesWidget: continued implementing list functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6697
diff changeset
93
6677
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
94 self.__process = QProcess()
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
95 self.__process.readyReadStandardOutput.connect(self.__readStdout)
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
96 self.__process.readyReadStandardError.connect(self.__readStderr)
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
97 self.__process.finished.connect(self.__finish)
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
98
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
99 self.__process.start(self.__condaExe, arguments)
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
100 procStarted = self.__process.waitForStarted(5000)
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
101 if not procStarted:
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
102 E5MessageBox.critical(
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
103 self,
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
104 self.tr("Conda Execution"),
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
105 self.tr("""The conda executable could not be started. Is it"""
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
106 """ configured correctly?"""))
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
107 self.__finish(1, 0)
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
108 else:
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
109 self.__logOutput(self.tr("Operation started.\n"))
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
110
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
111 def __finish(self, exitCode, exitStatus, giveUp=False):
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
112 """
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
113 Private slot called when the process finished.
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
114
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
115 It is called when the process finished or
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
116 the user pressed the button.
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
117
6697
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6685
diff changeset
118 @param exitCode exit code of the process
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6685
diff changeset
119 @type int
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6685
diff changeset
120 @param exitStatus exit status of the process
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6685
diff changeset
121 @type QProcess.ExitStatus
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6685
diff changeset
122 @param giveUp flag indicating to not start another attempt
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6685
diff changeset
123 @type bool
6677
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
124 """
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
125 if self.__process is not None and \
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
126 self.__process.state() != QProcess.NotRunning:
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
127 self.__process.terminate()
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
128 QTimer.singleShot(2000, self.__process.kill)
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
129 self.__process.waitForFinished(3000)
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
130
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
131 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True)
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
132 self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False)
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
133 self.buttonBox.button(QDialogButtonBox.Close).setDefault(True)
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
134
6683
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
135 self.progressLabel.hide()
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
136 self.progressBar.hide()
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
137
6697
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6685
diff changeset
138 self.__statusOk = exitCode == 0
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6685
diff changeset
139
6677
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
140 self.__logOutput(self.tr("Operation finished.\n"))
6697
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6685
diff changeset
141 if not self.__json and self.__bufferedStdout:
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6685
diff changeset
142 self.__logOutput(self.__bufferedStdout)
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6685
diff changeset
143
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6685
diff changeset
144 if self.__json and self.__bufferedStdout:
6683
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
145 index = self.__bufferedStdout.find("{")
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
146 rindex = self.__bufferedStdout.rfind("}")
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
147 self.__bufferedStdout = self.__bufferedStdout[index:rindex + 1]
6677
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
148 try:
6697
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6685
diff changeset
149 self.__result = json.loads(self.__bufferedStdout)
6677
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
150 except Exception as error:
6697
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6685
diff changeset
151 self.__result = {}
6677
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
152 self.__logError(str(error))
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
153 return
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
154
6697
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6685
diff changeset
155 if "error" in self.__result:
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6685
diff changeset
156 self.__logError(self.__result["error"])
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6685
diff changeset
157 self.__statusOk = False
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6685
diff changeset
158 elif "success" in self.__result and \
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6685
diff changeset
159 not self.__result["success"]:
6685
fbaee9890715 CondaExecDialog: did some cleanup and streamlining.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6683
diff changeset
160 self.__logError(
fbaee9890715 CondaExecDialog: did some cleanup and streamlining.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6683
diff changeset
161 self.tr("Conda command '{0}' did not return success.")
fbaee9890715 CondaExecDialog: did some cleanup and streamlining.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6683
diff changeset
162 .format(self.__condaCommand))
6697
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6685
diff changeset
163 self.__statusOk = False
6677
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
164
6697
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6685
diff changeset
165 def getResult(self):
6677
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
166 """
6697
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6685
diff changeset
167 Public method to the result of the command execution.
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6685
diff changeset
168
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6685
diff changeset
169 @return tuple containing a flag indicating success and the result data.
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6685
diff changeset
170 @rtype tuple of (bool, dict)
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6685
diff changeset
171 """
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6685
diff changeset
172 return self.__statusOk, self.__result
6683
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
173
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
174 def __setProgressValues(self, jsonDict, progressType):
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
175 """
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
176 Private method to set the value of the progress bar.
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
177
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
178 @param jsonDict dictionary containing the progress info
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
179 @type dict
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
180 @param progressType action type to check for
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
181 @type str
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
182 @return flag indicating success
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
183 @rtype bool
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
184 """
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
185 if progressType in jsonDict and "progress" in jsonDict:
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
186 if jsonDict["maxval"] == 1:
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
187 self.progressBar.setMaximum(100)
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
188 # percent values
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
189 self.progressBar.setValue(
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
190 int(jsonDict["progress"] * 100))
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
191 parts = jsonDict["fetch"].split("|")
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
192 filename = parts[0].strip()
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
193 filesize = parts[1].strip()
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
194 else:
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
195 self.progressBar.setMaximum(jsonDict["maxval"])
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
196 self.progressBar.setValue(jsonDict["progress"])
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
197 filename = jsonDict["fetch"].strip()
6697
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6685
diff changeset
198 filesize = Globals.dataString(int(jsonDict["maxval"]))
6683
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
199
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
200 self.progressLabel.setText(
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
201 self.tr("{0} (Size: {1})").format(filename, filesize))
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
202
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
203 if progressType == "fetch":
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
204 if filename != self.__lastFetchFile:
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
205 self.__logOutput(
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
206 self.tr("Fetching {0} ...").format(filename))
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
207 self.__lastFetchFile = filename
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
208 elif jsonDict["finished"]:
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
209 self.__logOutput(self.tr("Done.\n"))
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
210
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
211 if self.__firstProgress:
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
212 self.progressLabel.show()
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
213 self.progressBar.show()
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
214 self.__firstProgress = False
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
215
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
216 return True
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
217
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
218 return False
6677
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
219
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
220 def __readStdout(self):
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
221 """
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
222 Private slot to handle the readyReadStandardOutput signal.
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
223
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
224 It reads the output of the process, formats it and inserts it into
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
225 the contents pane.
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
226 """
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
227 all_stdout = str(self.__process.readAllStandardOutput(),
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
228 Preferences.getSystem("IOEncoding"),
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
229 'replace')
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
230 all_stdout = all_stdout.replace("\x00", "")
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
231 if self.__json:
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
232 for stdout in all_stdout.splitlines():
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
233 try:
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
234 jsonDict = json.loads(stdout.replace("\x00", "").strip())
6683
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
235 if self.__setProgressValues(jsonDict, "fetch"):
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
236 # nothing to do anymore
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
237 pass
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
238 elif "progress" not in jsonDict:
6677
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
239 if self.__bufferedStdout is None:
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
240 self.__bufferedStdout = stdout
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
241 else:
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
242 self.__bufferedStdout += stdout
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
243 except (TypeError, ValueError):
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
244 if self.__bufferedStdout is None:
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
245 self.__bufferedStdout = stdout
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
246 else:
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
247 self.__bufferedStdout += stdout
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
248 else:
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
249 self.__logOutput(all_stdout)
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
250
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
251 def __readStderr(self):
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
252 """
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
253 Private slot to handle the readyReadStandardError signal.
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
254
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
255 It reads the error output of the process and inserts it into the
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
256 error pane.
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
257 """
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
258 self.__process.setReadChannel(QProcess.StandardError)
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
259
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
260 while self.__process.canReadLine():
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
261 stderr = str(self.__process.readLine(),
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
262 Preferences.getSystem("IOEncoding"),
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
263 'replace')
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
264 self.__logError(stderr)
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
265
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
266 def __logOutput(self, stdout):
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
267 """
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
268 Private method to log some output.
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
269
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
270 @param stdout output string to log
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
271 @type str
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
272 """
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
273 self.contents.insertPlainText(stdout)
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
274 self.contents.ensureCursorVisible()
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
275
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
276 def __logError(self, stderr):
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
277 """
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
278 Private method to log an error.
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
279
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
280 @param stderr error string to log
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
281 @type str
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
282 """
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
283 self.errorGroup.show()
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
284 self.errors.insertPlainText(stderr)
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
285 self.errors.ensureCursorVisible()

eric ide

mercurial