예제 #1
0
    def execute(self, class_, command, **kw):
        if command is None:
            return False

        registry.commands()[command] = class_
        class_.name = command
        return True
예제 #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
예제 #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)
예제 #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
예제 #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)
예제 #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