Re: Passing along cmd.Cmd completion to contained class

2011-12-02 Thread Miki Tebeka
This is not tested, but maybe it'll work :) def complete(self, text, state): if text.startswith('config): return self.config.complete(text, state) return Cmd.complete(self, text, state) -- http://mail.python.org/mailman/listinfo/python-list

Passing along cmd.Cmd completion to contained class

2011-12-01 Thread Tim Chase
I have sub-classes of cmd.Cmd in an arrangement somewhat like class Config(cmd.Cmd): def do_foo(self, line): print "Fooing %r" % line def complete_foo(self, text, line, begidx, endidx): ... class MyTUI(cmd.Cmd): def __init__(self, configger=Config, *args, **kwargs): c