parameters: (device, command_queue)
docstring: Executes on the device a command queue.
  
    Args:
      device: The device to execute the shell commands to.
      command_queue: a list of commands to be executed in that order.
docstring_summary: Executes on the device a command queue.
docstring_tokens: Executes on the device a command queue .
function: def DeviceSubmitShellCommandQueue(device, command_queue):
    """Executes on the device a command queue.
  
    Args:
      device: The device to execute the shell commands to.
      command_queue: a list of commands to be executed in that order.
    """
    REMOTE_COMMAND_FILE_PATH = '/data/local/tmp/adb_command_file.sh'
    if not command_queue:
      return
    with tempfile.NamedTemporaryFile(prefix='adb_command_file_',
                                     suffix='.sh') as command_file:
      command_file.write('#!/bin/sh\n')
      command_file.write('# Shell file generated by {}\'s {}\n'.format(
          __file__, DeviceSubmitShellCommandQueue.__name__))
      command_file.write('set -e\n')
      for command in command_queue:
        command_file.write(subprocess.list2cmdline(command) + ' ;\n')
      command_file.write('exit 0;\n'.format(
          REMOTE_COMMAND_FILE_PATH))
      command_file.flush()
      device.adb.Push(command_file.name, REMOTE_COMMAND_FILE_PATH)
      device.adb.Shell('sh {p} && rm {p}'.format(p=REMOTE_COMMAND_FILE_PATH))
function_tokens: def DeviceSubmitShellCommandQueue ( device , command_queue ) : REMOTE_COMMAND_FILE_PATH = '/data/local/tmp/adb_command_file.sh' if not command_queue : return with tempfile . NamedTemporaryFile ( prefix = 'adb_command_file_' , suffix = '.sh' ) as command_file : command_file . write ( '#!/bin/sh\n' ) command_file . write ( '# Shell file generated by {}\'s {}\n' . format ( __file__ , DeviceSubmitShellCommandQueue . __name__ ) ) command_file . write ( 'set -e\n' ) for command in command_queue : command_file . write ( subprocess . list2cmdline ( command ) + ' ;\n' ) command_file . write ( 'exit 0;\n' . format ( REMOTE_COMMAND_FILE_PATH ) ) command_file . flush ( ) device . adb . Push ( command_file . name , REMOTE_COMMAND_FILE_PATH ) device . adb . Shell ( 'sh {p} && rm {p}' . format ( p = REMOTE_COMMAND_FILE_PATH ) )