def launch_local_console(input_stream, console_log_path, pattern_paths=None):
 (r, w) = os.pipe()
 local_script_path = os.path.join(MONITORDIR, 'console.py')
 console_cmd = [sys.executable, local_script_path]
 if pattern_paths:
  console_cmd.append(('--pattern_paths=%s' % ','.join(pattern_paths)))
 console_cmd += [console_log_path, str(w)]
 warning_stream = os.fdopen(r, 'r', 0)
 devnull_w = open(os.devnull, 'w')
 console_proc = subprocess.Popen(console_cmd, stdin=input_stream, stdout=devnull_w, stderr=devnull_w)
 os.close(w)
 return (console_proc, warning_stream)

def launch_local_console ( input_stream , console_log_path , pattern_paths = None ) : ( r , w ) = os . pipe ( ) local_script_path = os . path . join ( MONITORDIR , 'console.py' ) console_cmd = [ sys . executable , local_script_path ] if pattern_paths : console_cmd . append ( ( '--pattern_paths=%s' % ',' . join ( pattern_paths ) ) ) console_cmd += [ console_log_path , str ( w ) ] warning_stream = os . fdopen ( r , 'r' , 0 ) devnull_w = open ( os . devnull , 'w' ) console_proc = subprocess . Popen ( console_cmd , stdin = input_stream , stdout = devnull_w , stderr = devnull_w ) os . close ( w ) return ( console_proc , warning_stream )
launch console .