예제 #1
0
 def __init__(self):
     cmd2.Cmd.__init__(self)
     self.prompt = self.colorize("pbap> ", "yellow")
     self.intro = self.colorize("Welcome to the PhoneBook Access Profile!",
                                "green")
     self.client = None
     self._store_history()
     cmd2.set_use_arg_list(False)
예제 #2
0
    def __init__(self):
        # Enable the optional ipy command if IPython is installed by setting use_ipython=True
        Cmd.__init__(self, use_ipython=True)
        self._set_prompt()
        self.autorun_on_edit = False
        self.intro = 'Happy 𝛑 Day.  Note the full Unicode support:  😇  (Python 3 only)  💩'

        # For option commands, pass a list of argument strings instead of a single argument string to the do_* methods
        set_use_arg_list(True)
예제 #3
0
    def __init__(self):
        self.multilineCommands = ['orate']
        self.maxrepeats = 3

        # Add stuff to settable and shortcutgs before calling base class initializer
        self.settable['maxrepeats'] = 'max repetitions for speak command'
        self.shortcuts.update({'&': 'speak'})

        # Set use_ipython to True to enable the "ipy" command which embeds and interactive IPython shell
        Cmd.__init__(self, use_ipython=False)

        # For option commands, pass a single argument string instead of a list of argument strings to the do_* methods
        set_use_arg_list(False)
예제 #4
0
    def __init__(self, *args, **kwargs):
        self.multilineCommands = ['orate']
        self.maxrepeats = 3
        self.redirector = '->'

        # Add stuff to settable and/or shortcuts before calling base class initializer
        self.settable['maxrepeats'] = 'Max number of `--repeat`s allowed'

        # Need to use this older form of invoking super class constructor to support Python 2.x and Python 3.x
        Cmd.__init__(self, *args, **kwargs)
        self.intro = 'This is an intro banner ...'

        # Configure how arguments are parsed for @options commands
        set_posix_shlex(False)
        set_strip_quotes(True)
        set_use_arg_list(False)
예제 #5
0
파일: test_cmd2.py 프로젝트: ksunden/cmd2
def noarglist_app():
    cmd2.set_use_arg_list(False)
    app = cmd2.Cmd()
    app.stdout = StdOut()
    return app