Coverage for qutebrowser/misc/guiprocess.py : 100%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # qutebrowser is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
QProcessEnvironment)
# A mapping of QProcess::ErrorCode's to human-readable strings.
QProcess.FailedToStart: "The process failed to start.", QProcess.Crashed: "The process crashed.", QProcess.Timedout: "The last waitFor...() function timed out.", QProcess.WriteError: ("An error occurred when attempting to write to the " "process."), QProcess.ReadError: ("An error occurred when attempting to read from the " "process."), QProcess.UnknownError: "An unknown error occurred.", }
"""An external process which shows notifications in the GUI.
Args: cmd: The command which was started. args: A list of arguments which gets passed. verbose: Whether to show more messages. _started: Whether the underlying process is started. _proc: The underlying QProcess. _what: What kind of thing is spawned (process/editor/userscript/...). Used in messages.
Signals: error/finished/started signals proxied from QProcess. """
parent=None):
def on_error(self, error): """Show a message if there was an error while spawning."""
def on_finished(self, code, status): """Show a message when the process finished.""" code, status))
encoding, 'replace') encoding, 'replace')
stdout, stderr)
self._what.capitalize())) else: # We call this 'status' here as it makes more sense to the user - # it's actually 'code'. "details.".format(self._what.capitalize(), code))
"""Produce a formatted string for spawn output."""
"\nProcess stdout:\n {}" "\nProcess stderr:\n {}").format(code, status, stdout, stderr)
def on_started(self): """Called when the process started successfully."""
"""Prepare starting of a QProcess."""
"""Convenience wrapper around QProcess::start.""" else:
"""Convenience wrapper around QProcess::startDetached."""
else: self._what, ERROR_STRINGS[self._proc.error()]))
|