def system_call(cmd, error_msg):
 proc = Popen(cmd, shell=True, universal_newlines=True, stdout=PIPE, stderr=PIPE)
 (stdout, stderr) = proc.communicate()
 return_value = proc.returncode
 success = (return_value == 0)
 if (not success):
  status(('Unable to %s:' % error_msg))
  status('  stdout:')
  for line in stdout.split('\n'):
   status(('    ' + line))
  status('  stderr:')
  for line in stderr.split('\n'):
   status(('    ' + line))
 return success

def system_call ( cmd , error_msg ) : proc = Popen ( cmd , shell = True , universal_newlines = True , stdout = PIPE , stderr = PIPE ) ( stdout , stderr ) = proc . communicate ( ) return_value = proc . returncode success = ( return_value == 0 ) if ( not success ) : status ( ( 'Unable to %s:' % error_msg ) ) status ( '  stdout:' ) for line in stdout . split ( '\n' ) : status ( ( '    ' + line ) ) status ( '  stderr:' ) for line in stderr . split ( '\n' ) : status ( ( '    ' + line ) ) return success
call cmd and return whether it was successful or not .