import subprocess
from .command import Command


def call(command):
  cmd  = Command()
  proc = subprocess.Popen(
      command,
      shell=True,
      stdout=subprocess.PIPE,
      stderr=subprocess.PIPE
  )

  out, err = proc.communicate()

  cmd.stdout   = out.strip()
  cmd.stderr   = err.strip()
  cmd.exitcode = proc.returncode

  return cmd

import subprocess
from .command import Command


def call(command):
  cmd  = Command()
  proc = subprocess.Popen(
      command,
      shell=True,
      stdout=subprocess.PIPE,
      stderr=subprocess.PIPE
  )

  out, err = proc.communicate()

  cmd.stdout   = out.strip()
  cmd.stderr   = err.strip()
  cmd.exitcode = proc.returncode

  return cmd
