Skip to content
Snippets Groups Projects
Commit 318ae55e authored by Bob Lantz's avatar Bob Lantz
Browse files

Allow sendCmd( [ cmd, arg1, ... ] )

parent bf9c6ab7
No related branches found
No related tags found
No related merge requests found
......@@ -194,8 +194,13 @@ def sendCmd( self, *args, **kwargs ):
printPid: print command's PID?"""
assert not self.waiting
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
# Convert to string
if not isinstance( cmd, str ):
cmd = ' '.join( [ str( c ) for c in cmd ] )
if not re.search( r'\w', cmd ):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment