Beispiel #1
0
    def perform(self, action, names):
        if action == 'load':
            return self._load_elements(names)

        if action == 'start':
            return self.start_elements(names)

        if isinstance(names, six.string_types):
            names = Split.split_words(names)

        return self.perform_element(action, names)
Beispiel #2
0
  def perform(self, action, names):
    if action == 'load':
      return self._load_elements(names)

    if action == 'start':
      return self.start_elements(names)

    if isinstance(names, six.string_types):
      names = Split.split_words(names)

    return self.perform_element(action, names)
Beispiel #3
0
  def expand(*cmds):
    for command in cmds:
      parts = Split.split_words(command)
      name = parts.pop(0)
      alias = aliases.get_prefix(command)
      if alias:
        cmd, alias_commands = alias
        if cmd == command or name != REGISTRY.entry(name).name:
          assert cmd not in stack
          stack.add(cmd)
          expand(*alias_commands)
          stack.remove(cmd)
          continue

      result.append([REGISTRY.function(name), parts])
Beispiel #4
0
    def expand(*cmds):
        for command in cmds:
            parts = Split.split_words(command)
            name = parts.pop(0)
            alias = aliases.get_prefix(command)
            if alias:
                cmd, alias_commands = alias
                if (cmd == command
                        or name != Registry.registry().entry(name).name):
                    assert cmd not in stack
                    stack.add(cmd)
                    expand(*alias_commands)
                    stack.remove(cmd)
                    continue

            result.append([Registry.registry().function(name), parts])