Пример #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