def check_script(filename):
 file_to_run = 'python -c"import warnings; '
 file_to_run += "warnings.simplefilter('ignore'); "
 file_to_run += "from matplotlib import use; use('Agg'); "
 file_to_run += ('execfile(r\'%s\')"' % os.path.join(example_dir, filename))
 proc = subprocess.Popen(file_to_run, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
 (stdout, stderr) = proc.communicate()
 result = proc.returncode
 if (result != 0):
  msg = ('Not generating reST from %s. An error occurred.\n' % filename)
  msg += stderr
  print msg
  return False
 return True

def check_script ( filename ) : file_to_run = 'python -c"import warnings; ' file_to_run += "warnings.simplefilter('ignore'); " file_to_run += "from matplotlib import use; use('Agg'); " file_to_run += ( 'execfile(r\'%s\')"' % os . path . join ( example_dir , filename ) ) proc = subprocess . Popen ( file_to_run , shell = True , stdout = subprocess . PIPE , stderr = subprocess . PIPE ) ( stdout , stderr ) = proc . communicate ( ) result = proc . returncode if ( result != 0 ) : msg = ( 'Not generating reST from %s. An error occurred.\n' % filename ) msg += stderr print msg return False return True
run all the files in filelist from run_all .