CondaInterface/CondaExecDialog.py

Sun, 03 Feb 2019 16:59:36 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 03 Feb 2019 16:59:36 +0100
branch
conda
changeset 6697
2f5c951bdf14
parent 6685
fbaee9890715
child 6706
d792e054cde2
permissions
-rw-r--r--

Conda interface: added capability to remove conda environments the conda way.

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
6677
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
92 self.__process = QProcess()
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
93 self.__process.readyReadStandardOutput.connect(self.__readStdout)
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
94 self.__process.readyReadStandardError.connect(self.__readStderr)
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
95 self.__process.finished.connect(self.__finish)
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
96
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
97 self.__process.start(self.__condaExe, arguments)
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
98 procStarted = self.__process.waitForStarted(5000)
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
99 if not procStarted:
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
100 E5MessageBox.critical(
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
101 self,
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
102 self.tr("Conda Execution"),
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
103 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
104 """ configured correctly?"""))
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
105 self.__finish(1, 0)
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
106 else:
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
107 self.__logOutput(self.tr("Operation started.\n"))
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
108
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
109 def __finish(self, exitCode, exitStatus, giveUp=False):
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 Private slot called when the process finished.
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 It is called when the process finished or
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
114 the user pressed the button.
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
115
6697
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6685
diff changeset
116 @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
117 @type int
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6685
diff changeset
118 @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
119 @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
120 @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
121 @type bool
6677
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
122 """
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
123 if self.__process is not None and \
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
124 self.__process.state() != QProcess.NotRunning:
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
125 self.__process.terminate()
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
126 QTimer.singleShot(2000, self.__process.kill)
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
127 self.__process.waitForFinished(3000)
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
128
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
129 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True)
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
130 self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False)
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
131 self.buttonBox.button(QDialogButtonBox.Close).setDefault(True)
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
132
6683
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
133 self.progressLabel.hide()
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
134 self.progressBar.hide()
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
135
6697
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6685
diff changeset
136 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
137
6677
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
138 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
139 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
140 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
141
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6685
diff changeset
142 if self.__json and self.__bufferedStdout:
6683
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
143 index = self.__bufferedStdout.find("{")
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
144 rindex = self.__bufferedStdout.rfind("}")
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
145 self.__bufferedStdout = self.__bufferedStdout[index:rindex + 1]
6677
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
146 try:
6697
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6685
diff changeset
147 self.__result = json.loads(self.__bufferedStdout)
6677
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
148 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
149 self.__result = {}
6677
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
150 self.__logError(str(error))
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
151 return
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
152
6697
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6685
diff changeset
153 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
154 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
155 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
156 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
157 not self.__result["success"]:
6685
fbaee9890715 CondaExecDialog: did some cleanup and streamlining.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6683
diff changeset
158 self.__logError(
fbaee9890715 CondaExecDialog: did some cleanup and streamlining.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6683
diff changeset
159 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
160 .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
161 self.__statusOk = False
6677
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
162
6697
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6685
diff changeset
163 def getResult(self):
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 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
166
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6685
diff changeset
167 @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
168 @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
169 """
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6685
diff changeset
170 return self.__statusOk, self.__result
6683
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
171
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
172 def __setProgressValues(self, jsonDict, progressType):
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 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
175
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
176 @param jsonDict dictionary containing the progress info
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
177 @type dict
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
178 @param progressType action type to check for
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
179 @type str
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
180 @return flag indicating success
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
181 @rtype bool
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
182 """
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
183 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
184 if jsonDict["maxval"] == 1:
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
185 self.progressBar.setMaximum(100)
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
186 # percent values
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
187 self.progressBar.setValue(
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
188 int(jsonDict["progress"] * 100))
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
189 parts = jsonDict["fetch"].split("|")
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
190 filename = parts[0].strip()
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
191 filesize = parts[1].strip()
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
192 else:
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
193 self.progressBar.setMaximum(jsonDict["maxval"])
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
194 self.progressBar.setValue(jsonDict["progress"])
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
195 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
196 filesize = Globals.dataString(int(jsonDict["maxval"]))
6683
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
197
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
198 self.progressLabel.setText(
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
199 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
200
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
201 if progressType == "fetch":
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
202 if filename != self.__lastFetchFile:
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
203 self.__logOutput(
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
204 self.tr("Fetching {0} ...").format(filename))
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
205 self.__lastFetchFile = filename
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
206 elif jsonDict["finished"]:
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
207 self.__logOutput(self.tr("Done.\n"))
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
208
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
209 if self.__firstProgress:
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
210 self.progressLabel.show()
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
211 self.progressBar.show()
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
212 self.__firstProgress = False
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
213
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
214 return True
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 False
6677
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
217
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
218 def __readStdout(self):
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 Private slot to handle the readyReadStandardOutput signal.
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 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
223 the contents pane.
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
224 """
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
225 all_stdout = str(self.__process.readAllStandardOutput(),
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
226 Preferences.getSystem("IOEncoding"),
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
227 'replace')
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
228 all_stdout = all_stdout.replace("\x00", "")
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
229 if self.__json:
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
230 for stdout in all_stdout.splitlines():
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
231 try:
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
232 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
233 if self.__setProgressValues(jsonDict, "fetch"):
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
234 # nothing to do anymore
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
235 pass
aca9d39fbfbd CondaExecDialog: finished the progress bar function
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6679
diff changeset
236 elif "progress" not in jsonDict:
6677
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
237 if self.__bufferedStdout is None:
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
238 self.__bufferedStdout = stdout
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
239 else:
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 except (TypeError, ValueError):
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
242 if self.__bufferedStdout is None:
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
243 self.__bufferedStdout = stdout
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
244 else:
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.__logOutput(all_stdout)
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
248
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
249 def __readStderr(self):
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 Private slot to handle the readyReadStandardError signal.
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 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
254 error pane.
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
255 """
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
256 self.__process.setReadChannel(QProcess.StandardError)
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 while self.__process.canReadLine():
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
259 stderr = str(self.__process.readLine(),
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
260 Preferences.getSystem("IOEncoding"),
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
261 'replace')
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
262 self.__logError(stderr)
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
263
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
264 def __logOutput(self, stdout):
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 Private method to log some output.
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 @param stdout output string to log
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
269 @type str
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
270 """
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
271 self.contents.insertPlainText(stdout)
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
272 self.contents.ensureCursorVisible()
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
273
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
274 def __logError(self, stderr):
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 Private method to log an error.
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 @param stderr error string to log
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
279 @type str
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
280 """
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
281 self.errorGroup.show()
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
282 self.errors.insertPlainText(stderr)
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
283 self.errors.ensureCursorVisible()

eric ide

mercurial