Exemplo n.º 1
0
    def execute(self, class_, command, **kw):
        if command is None:
            return False

        registry.commands()[command] = class_
        class_.name = command
        return True
Exemplo n.º 2
0
    def execute(self, class_, alias, **kwargs):
        if not getattr(class_, 'aliases', None):
            class_.aliases = []

        if alias:
            class_.aliases.append(alias)
            registry.commands()[alias] = class_

        return False
Exemplo n.º 3
0
    def content(self):
        # circular import
        from opennode.oms.endpoint.ssh.cmd import registry

        return dict((name, Command(name, self, cmd))
                    for name, cmd in registry.commands().items() if name)
Exemplo n.º 4
0
 def test_help(self):
     self._cmd('help')
     with assert_mock(self.terminal) as t:
         for cmd in commands().keys():
             assert cmd in current_call(t).arg
Exemplo n.º 5
0
    def content(self):
        # circular import
        from opennode.oms.endpoint.ssh.cmd import registry

        return dict((name, Command(name, self, cmd)) for name, cmd in registry.commands().items() if name)
Exemplo n.º 6
0
 def test_help(self):
     self._cmd('help')
     with assert_mock(self.terminal) as t:
         for cmd in commands().keys():
             assert cmd in current_call(t).arg