parameters: (output, dir, *cmditems)
return_statement: return child.wait()
docstring: Internal routine to run a shell command in a given directory.
docstring_summary: Internal routine to run a shell command in a given directory.
docstring_tokens: Internal routine to run a shell command in a given directory .
function: def _cmd(output, dir, *cmditems):
      """Internal routine to run a shell command in a given directory."""
  
      cmd = ("cd \"%s\"; " % dir) + " ".join(cmditems)
      if output:
          output.write("+ %s\n" % cmd)
      if NO_EXECUTE:
          return 0
      child = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE,
                               stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
      child.stdin.close()
      while 1:
          line = child.stdout.readline()
          if not line:
              break
          if output:
              output.write(line)
      return child.wait()
function_tokens: def _cmd ( output , dir , * cmditems ) : cmd = ( "cd \"%s\"; " % dir ) + " " . join ( cmditems ) if output : output . write ( "+ %s\n" % cmd ) if NO_EXECUTE : return 0 child = subprocess . Popen ( cmd , shell = True , stdin = subprocess . PIPE , stdout = subprocess . PIPE , stderr = subprocess . STDOUT ) child . stdin . close ( ) while 1 : line = child . stdout . readline ( ) if not line : break if output : output . write ( line ) return child . wait ( )