Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #28648 - jdm:mach-vendor, r=jdm
Vendor mach-1.0.0. This will allow us to fork the package and make the changes necessary to solve #28631.
- Loading branch information
Showing
24 changed files
with
2,850 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
Metadata-Version: 1.1 | ||
Name: mach | ||
Version: 1.0.0 | ||
Summary: Generic command line command dispatching framework. | ||
Home-page: https://developer.mozilla.org/en-US/docs/Developer_Guide/mach | ||
Author: Gregory Szorc | ||
Author-email: gregory.szorc@gmail.com | ||
License: MPL 2.0 | ||
Description: ==== | ||
mach | ||
==== | ||
|
||
Mach (German for *do*) is a generic command dispatcher for the command | ||
line. | ||
|
||
To use mach, you install the mach core (a Python package), create an | ||
executable *driver* script (named whatever you want), and write mach | ||
commands. When the *driver* is executed, mach dispatches to the | ||
requested command handler automatically. | ||
|
||
To learn more, read the docs in ``docs/``. | ||
|
||
Platform: UNKNOWN | ||
Classifier: Environment :: Console | ||
Classifier: Development Status :: 5 - Production/Stable | ||
Classifier: License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0) | ||
Classifier: Natural Language :: English | ||
Classifier: Programming Language :: Python :: 2.7 | ||
Classifier: Programming Language :: Python :: 3.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
==== | ||
mach | ||
==== | ||
|
||
Mach (German for *do*) is a generic command dispatcher for the command | ||
line. | ||
|
||
To use mach, you install the mach core (a Python package), create an | ||
executable *driver* script (named whatever you want), and write mach | ||
commands. When the *driver* is executed, mach dispatches to the | ||
requested command handler automatically. | ||
|
||
To learn more, read the docs in ``docs/``. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
Metadata-Version: 1.1 | ||
Name: mach | ||
Version: 1.0.1 | ||
Summary: Generic command line command dispatching framework. | ||
Home-page: https://developer.mozilla.org/en-US/docs/Developer_Guide/mach | ||
Author: Gregory Szorc | ||
Author-email: gregory.szorc@gmail.com | ||
License: MPL 2.0 | ||
Description: ==== | ||
mach | ||
==== | ||
|
||
Mach (German for *do*) is a generic command dispatcher for the command | ||
line. | ||
|
||
To use mach, you install the mach core (a Python package), create an | ||
executable *driver* script (named whatever you want), and write mach | ||
commands. When the *driver* is executed, mach dispatches to the | ||
requested command handler automatically. | ||
|
||
To learn more, read the docs in ``docs/``. | ||
|
||
Platform: UNKNOWN | ||
Classifier: Environment :: Console | ||
Classifier: Development Status :: 5 - Production/Stable | ||
Classifier: License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0) | ||
Classifier: Natural Language :: English | ||
Classifier: Programming Language :: Python :: 2.7 | ||
Classifier: Programming Language :: Python :: 3.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
README.rst | ||
setup.cfg | ||
setup.py | ||
mach/__init__.py | ||
mach/base.py | ||
mach/config.py | ||
mach/decorators.py | ||
mach/dispatcher.py | ||
mach/logging.py | ||
mach/main.py | ||
mach/registrar.py | ||
mach/terminal.py | ||
mach/util.py | ||
mach.egg-info/PKG-INFO | ||
mach.egg-info/SOURCES.txt | ||
mach.egg-info/dependency_links.txt | ||
mach.egg-info/requires.txt | ||
mach.egg-info/top_level.txt | ||
mach/mixin/__init__.py | ||
mach/mixin/logging.py | ||
mach/mixin/process.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
blessings | ||
mozfile | ||
mozprocess | ||
six |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
mach |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# 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/. | ||
|
||
from __future__ import absolute_import, unicode_literals | ||
|
||
|
||
class CommandContext(object): | ||
"""Holds run-time state so it can easily be passed to command providers.""" | ||
def __init__(self, cwd=None, settings=None, log_manager=None, commands=None, **kwargs): | ||
self.cwd = cwd | ||
self.settings = settings | ||
self.log_manager = log_manager | ||
self.commands = commands | ||
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 UnknownCommandError(MachError): | ||
"""Raised when we attempted to execute an unknown command.""" | ||
|
||
def __init__(self, command, verb, suggested_commands=None): | ||
MachError.__init__(self) | ||
|
||
self.command = command | ||
self.verb = verb | ||
self.suggested_commands = suggested_commands or [] | ||
|
||
|
||
class UnrecognizedArgumentError(MachError): | ||
"""Raised when an unknown argument is passed to mach.""" | ||
|
||
def __init__(self, command, arguments): | ||
MachError.__init__(self) | ||
|
||
self.command = command | ||
self.arguments = arguments | ||
|
||
|
||
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. | ||
""" | ||
|
||
def __init__(self, message, exit_code=1, reason=''): | ||
Exception.__init__(self, message) | ||
self.exit_code = exit_code | ||
self.reason = reason | ||
|
||
|
||
class MissingFileError(MachError): | ||
"""Attempted to load a mach commands file that doesn't exist.""" |
Oops, something went wrong.