Allow sendCmd( [ cmd, arg1, ... ] )
This commit is contained in:
+6
-1
@@ -194,8 +194,13 @@ class Node( object ):
|
|||||||
printPid: print command's PID?"""
|
printPid: print command's PID?"""
|
||||||
assert not self.waiting
|
assert not self.waiting
|
||||||
printPid = kwargs.get( 'printPid', True )
|
printPid = kwargs.get( 'printPid', True )
|
||||||
if len( args ) > 0:
|
# Allow sendCmd( [ list ] )
|
||||||
|
if len( args ) == 1 and type( args[ 0 ] ) is list:
|
||||||
|
cmd = args[ 0 ]
|
||||||
|
# Allow sendCmd( cmd, arg1, arg2... )
|
||||||
|
elif len( args ) > 0:
|
||||||
cmd = args
|
cmd = args
|
||||||
|
# Convert to string
|
||||||
if not isinstance( cmd, str ):
|
if not isinstance( cmd, str ):
|
||||||
cmd = ' '.join( [ str( c ) for c in cmd ] )
|
cmd = ' '.join( [ str( c ) for c in cmd ] )
|
||||||
if not re.search( r'\w', cmd ):
|
if not re.search( r'\w', cmd ):
|
||||||
|
|||||||
Reference in New Issue
Block a user