def __init__( self, handler, **kw ) :
cmd.Cmd.__init__(self)
arguments = defaultArgMerging(BaseShell.Defaults, kw)
self.prompt_templ = arguments['prompt']
self.ignore_messages = arguments['ignore_messages']
self.output = arguments['output']
self.debug = arguments['debug']
subshells = arguments['subshells']
self.subshells_dict = {}
self.handler = handler
for stream_name, subshell_attrs in subshells.items() :
if type(subshell_attrs) is tuple :
subshell_class, subshell_kwargs = subshell_attrs
else :
subshell_class, subshell_kwargs = (subshell_attrs, dict())
self.addSubShell( stream_name, subshell_class, subshell_kwargs )
handler.onChunk = handlerCallbackHook( handler.onChunk, self.subshells_dict )
self.updatePrompt()
self.sysinfo = None
评论列表
文章目录