# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/.
class CommandContext: """Holds run-time state so it can easily be passed to command providers."""
def __init__(
self, cwd: str, settings=None, log_manager=None, commands=None, **kwargs
):
self.cwd = cwd
self.settings = settings
self.log_manager = log_manager
self.commands = commands
self.is_interactive = None# Filled in after args are parsed
self.telemetry = None# Filled in after args are parsed
self.command_attrs = {}
for k, v in kwargs.items():
setattr(self, k, v)
class MachError(Exception): """Base class for all errors raised by mach itself."""
class NoCommandError(MachError): """No command was passed into mach."""
class FailedCommandError(Exception): """Raised by commands to signal a handled failure to be printed by mach
When caught by mach a FailedCommandError will print message and exit with''exit_code''. The optional ''reason''is a string in cases where
other scripts may wish to handle the exception, though this is generally
intended to communicate failure to mach. """
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.