Beispiel #1
0
    def __init__(self, name):
        super(BadPlugin, self).__init__(name)

        self.add_command(
            command.ExecCommand('execute bad_function_1', self,
                                self.bad_function_1))
        self.add_command(
            command.ExecCommand('execute bad_function_2', self,
                                self.bad_function_2))
        self.add_command(
            command.ExecCommand('execute bad_function_3', self,
                                self.bad_function_3))
Beispiel #2
0
    def __init__(self, name):
        super(BehavedReadlineFriendlyDynamicPlugin, self).__init__(name)

        self.add_command(
            command.ExecCommand('unique <fruit> command <fruit>', self,
                                self.behaved_function_1))
        self.add_command(
            command.ExecCommand('universal <fruit> command', self,
                                self.behaved_function_1))

        self.add_dynamic_keyword_fn('<fruit>', self.resolve_dynamic_keyword)

        self.dyn_command_line = ''
Beispiel #3
0
    def __init__(self, name):
        super(BehavedPlugin, self).__init__(name)

        self.add_command(
            command.ExecCommand('conflicting command', self,
                                self.behaved_function_1))
        self.add_command(
            command.ExecCommand('non conflicting command',
                                self,
                                self.behaved_function_1,
                                allow_conflict=True))
        self.add_command(
            command.ExecCommand('unique %s command' % self.name, self,
                                self.behaved_function_1))
        self.add_command(
            command.ExecCommand('universal %s command' % self.name, self,
                                self.behaved_function_1))
        self.add_command(
            command.ExecCommand('unique %s command    with spaces' % self.name,
                                self, self.behaved_function_1))
        self.add_command(
            command.ExecCommand('reset',
                                self,
                                self.reset_state,
                                allow_conflict=True))

        self.add_command(
            command.LabelHelp('this is just a help label', self,
                              'This label cannot be executed'))
Beispiel #4
0
    def __init__(self, name):
        super(BehavedDynamicPlugin_2, self).__init__(name)

        self.add_command(
            command.ExecCommand('non conflicting <fruit> command',
                                self,
                                self.behaved_function_1,
                                allow_conflict=True))
        self.add_command(
            command.ExecCommand('conflicting <fruit> command', self,
                                self.behaved_function_1))
        self.add_command(
            command.ExecCommand('non conflicting <vegetable> command',
                                self,
                                self.behaved_function_1,
                                allow_conflict=True))
        self.add_command(
            command.ExecCommand('conflicting <vegetable> command', self,
                                self.behaved_function_1))
        self.add_command(
            command.ExecCommand('universal %s command' % self.name, self,
                                self.behaved_function_1))

        self.add_command(
            command.ExecCommand('reset',
                                self,
                                self.reset_state,
                                allow_conflict=True))

        self.add_dynamic_keyword_fn('<fruit>', self.resolve_dynamic_keyword)
        self.add_dynamic_keyword_fn('<vegetable>',
                                    self.resolve_dynamic_keyword_2)

        self.dyn_command_line = ''