示例#1
0
from west.commands import extension_commands, \
    CommandError, CommandContextError, ExtensionCommandError
from west.commands.project import List, ManifestCommand, Diff, Status, \
    SelfUpdate, ForAll, WestUpdated, PostInit, Update
from west.commands.config import Config
from west.manifest import Manifest, MalformedConfig
from west.util import quote_sh_list, west_topdir

PROJECT_COMMANDS = {
    'commands for managing multiple git repositories': [
        List(),
        ManifestCommand(),
        Diff(),
        Status(),
        Update(),
        SelfUpdate(),
        ForAll(),
    ],
    'configuring west': [Config()],
}

# Commands we don't want to show to the user. For now, this is PostInit.
HIDDEN_COMMANDS = {None: [PostInit()]}

# Built-in commands in this West. For compatibility with monorepo
# installations of West within the Zephyr tree, we only expose the
# project commands if this is a multirepo installation.
BUILTIN_COMMANDS = dict(PROJECT_COMMANDS)
BUILTIN_COMMANDS.update(HIDDEN_COMMANDS)

# Initialize the set with the virtual 'help' command so that an extension
示例#2
0
文件: main.py 项目: XIZHAOJUN/west
from west.version import __version__

BUILTIN_COMMANDS = {
    'commands for managing multiple git repositories': [
        Init(),
        Update(),
        List(),
        ManifestCommand(),
        Diff(),
        Status(),
        ForAll(),
    ],
    'configuring west': [Config()],

    # None is for hidden commands we don't want to show to the user.
    None: [SelfUpdate()]
}

# Initialize the set with the virtual 'help' command so that an extension
# command cannot clash with it
BUILTIN_COMMAND_NAMES = set(['help'])
for group, commands in BUILTIN_COMMANDS.items():
    BUILTIN_COMMAND_NAMES.update(c.name for c in commands)


class WestHelpAction(argparse.Action):
    def __init__(self, option_strings, dest, **kwargs):
        kwargs['nargs'] = 0
        super(WestHelpAction, self).__init__(option_strings, dest, **kwargs)

    def __call__(self, parser, namespace, values, option_string=None):
示例#3
0
from subprocess import CalledProcessError, check_output, DEVNULL
import textwrap

from west import log
from west import config
from west.commands import CommandError, CommandContextError, external_commands
from west.commands.project import List, Diff, Status, SelfUpdate, ForAll, \
                             WestUpdated, PostInit, Update
from west.manifest import Manifest, MalformedConfig
from west.util import quote_sh_list

PROJECT_COMMANDS = {
    'commands for managing multiple git repositories':
    [List(), Diff(),
     Status(), Update(),
     SelfUpdate(), ForAll()]
}

# Commands we don't want to show to the user. For now, this is PostInit.
HIDDEN_COMMANDS = {None: [PostInit()]}

# Built-in commands in this West. For compatibility with monorepo
# installations of West within the Zephyr tree, we only expose the
# project commands if this is a multirepo installation.
BUILTIN_COMMANDS = dict(PROJECT_COMMANDS)
BUILTIN_COMMANDS.update(HIDDEN_COMMANDS)

BUILTIN_COMMAND_NAMES = set()
for group, commands in BUILTIN_COMMANDS.items():
    BUILTIN_COMMAND_NAMES.add(c.name for c in commands)