Demote pip upgrade message from stderr to stdout in client output

Having that output stay on stderr and hence in shiny red looks way
too alarming considering that it's only a pip update that is not THAT
critical usually (and we don't want to do it automatically anyhow
considering how often that appears to break stuff).
This commit is contained in:
Gina Häußge 2016-11-23 14:28:50 +01:00
parent 5b910b557e
commit 5c39e9a8a3
2 changed files with 20 additions and 2 deletions

View file

@ -646,6 +646,7 @@ $(function() {
self.loglines.removeAll();
self.loglines.push({line: line, stream: "message"});
self._scrollWorkingOutputToEnd();
self.workingDialog.modal("show");
};
@ -746,7 +747,7 @@ $(function() {
if (messageType == "loglines" && self.working()) {
_.each(data.loglines, function(line) {
self.loglines.push(line);
self.loglines.push(self._preprocessLine(line));
});
self._scrollWorkingOutputToEnd();
} else if (messageType == "result") {
@ -861,6 +862,14 @@ $(function() {
self.requestData();
}
};
self._forcedStdoutLine = /You are using pip version .*?, however version .*? is available\.|You should consider upgrading via the '.*?' command\./;
self._preprocessLine = function(line) {
if (line.stream == "stderr" && line.line.match(self._forcedStdoutLine)) {
line.stream = "stdout";
}
return line;
}
}
// view model class, parameters for constructor, container to bind to

View file

@ -539,7 +539,7 @@ $(function() {
case "loglines": {
if (self.working()) {
_.each(messageData.loglines, function(line) {
self.loglines.push(line);
self.loglines.push(self._preprocessLine(line));
});
self._scrollWorkingOutputToEnd();
}
@ -557,6 +557,7 @@ $(function() {
self.loglines.push({line: _.repeat("+", text.length), stream: "separator"});
self.loglines.push({line: text, stream: "message"});
self.loglines.push({line: _.repeat("+", text.length), stream: "separator"});
self._scrollWorkingOutputToEnd();
self._updatePopup({
text: text,
hide: false,
@ -584,6 +585,7 @@ $(function() {
};
self.loglines.push({line: text, stream: "message"});
self._scrollWorkingOutputToEnd();
self.waitingForRestart = true;
self.restartTimeout = setTimeout(function() {
@ -694,6 +696,13 @@ $(function() {
}
};
self._forcedStdoutLine = /You are using pip version .*?, however version .*? is available\.|You should consider upgrading via the '.*?' command\./;
self._preprocessLine = function(line) {
if (line.stream == "stderr" && line.line.match(self._forcedStdoutLine)) {
line.stream = "stdout";
}
return line;
}
}
// view model class, parameters for constructor, container to bind to