Fix CLI constructor: stdin parameter was replaced

This also enables CLI users to pass parameters to its superclass: Cmd.
This commit is contained in:
Mathieu Jadin
2019-12-01 08:45:43 +01:00
parent e0436642ae
commit 6af291c968
+3 -3
View File
@@ -46,7 +46,8 @@ class CLI( Cmd ):
prompt = 'mininet> ' prompt = 'mininet> '
def __init__( self, mininet, stdin=sys.stdin, script=None ): def __init__( self, mininet, stdin=sys.stdin, script=None,
*args, **kwargs ):
"""Start and run interactive or batch mode CLI """Start and run interactive or batch mode CLI
mininet: Mininet network object mininet: Mininet network object
stdin: standard input for CLI stdin: standard input for CLI
@@ -55,11 +56,10 @@ class CLI( Cmd ):
# Local variable bindings for py command # Local variable bindings for py command
self.locals = { 'net': mininet } self.locals = { 'net': mininet }
# Attempt to handle input # Attempt to handle input
self.stdin = stdin
self.inPoller = poll() self.inPoller = poll()
self.inPoller.register( stdin ) self.inPoller.register( stdin )
self.inputFile = script self.inputFile = script
Cmd.__init__( self ) Cmd.__init__( self, *args, stdin=stdin, **kwargs )
info( '*** Starting CLI:\n' ) info( '*** Starting CLI:\n' )
if self.inputFile: if self.inputFile: