(command, stdin=None)
returns a dict based upon a subprocess call with a -plist argument.

  Args:
    command: the command to be executed as a list
    stdin: any standard input required.
  Returns:
    dict: dictionary from command output
  Raises:
    MacDiskError: Error running command
    MacDiskError: Error creating plist from standard output
returns a dict based upon a subprocess call with a -plist argument.
returns a dict based upon a subprocess call with a - plist argument .
def _DictFromSubprocess(command, stdin=None):
  """returns a dict based upon a subprocess call with a -plist argument.

  Args:
    command: the command to be executed as a list
    stdin: any standard input required.
  Returns:
    dict: dictionary from command output
  Raises:
    MacDiskError: Error running command
    MacDiskError: Error creating plist from standard output
  """

  task = {}

  if stdin:
    (task["stdout"],
     task["stderr"],
     task["returncode"]) = gmacpyutil.RunProcess(command, stdin)
  else:
    (task["stdout"],
     task["stderr"],
     task["returncode"]) = gmacpyutil.RunProcess(command)

  if task["returncode"] is not 0:
    raise MacDiskError("Error running command: %s, stderr: %s" %
                       (command, task["stderr"]))
  else:
    try:
      return plistlib.readPlistFromString(task["stdout"])
    except xml.parsers.expat.ExpatError:
      raise MacDiskError("Error creating plist from output: %s" %
                         task["stdout"])
def _DictFromSubprocess ( command , stdin = None ) : task = { } if stdin : ( task [ "stdout" ] , task [ "stderr" ] , task [ "returncode" ] ) = gmacpyutil . RunProcess ( command , stdin ) else : ( task [ "stdout" ] , task [ "stderr" ] , task [ "returncode" ] ) = gmacpyutil . RunProcess ( command ) if task [ "returncode" ] is not 0 : raise MacDiskError ( "Error running command: %s, stderr: %s" % ( command , task [ "stderr" ] ) ) else : try : return plistlib . readPlistFromString ( task [ "stdout" ] ) except xml . parsers . expat . ExpatError : raise MacDiskError ( "Error creating plist from output: %s" % task [ "stdout" ] )