# Path: auto_forensicate/errors.py
# class BadConfigOption(Exception):
# class ForensicateError(Exception):
# class RecipeException(Exception):
# class RetryableError(ForensicateError):
# 
# Path: auto_forensicate/hostinfo.py
# def ReadDMI(name):
# def GetChassisSerial():
# def GetMachineUUID():
# def GetRandomUUID():
# def GetIdentifier():
# def GetUdevadmInfo(device_name):
# def GetTime():
# def Which(cmd):
# 
# Path: auto_forensicate/macdisk.py
# class MacDiskError(Exception):
# class Disk(object):
# def _DictFromSubprocess(command):
# def _DictFromDiskutilInfo(deviceid):
# def _DictFromDiskutilList():
# def WholeDisks():
#   def __init__(self, deviceid):
#   def Refresh(self):
# 
# Path: auto_forensicate/recipes/base.py
# class BaseArtifact(object):
# class StringArtifact(BaseArtifact):
# class FileArtifact(BaseArtifact):
# class ProcessOutputArtifact(BaseArtifact):
# class BaseRecipe(object):
#   def __init__(self, name):
#   def _GetStream(self):
#   def CloseStream(self):
#   def OpenStream(self):
#   def size(self):
#   def readable_size(self):
#   def __init__(self, path, string_content):
#   def _GetStream(self):
#   def CloseStream(self):
#   def __init__(self, path):
#   def _GetStream(self):
#   def __init__(self, command, path, ignore_failure=False):
#   def _RunCommand(self):
#   def _GetStream(self):
#   def __init__(self, name, options=None):
#   def __enter__(self):
#   def __exit__(self, exc_type, exc_value, traceback):
#   def GetArtifacts(self):
# 
# Path: auto_forensicate/ux/cli.py
# def AskText(message, mandatory=False):
# def AskDiskList(disk_list):
# def Confirm(text, default='N'):
# 
# Path: auto_forensicate/ux/gui.py
# def AskText(message, mandatory=False):
# def AskDiskList(disk_list):
# def Confirm(text):


import json
import os
import subprocess
from auto_forensicate import errors
from auto_forensicate import hostinfo
from auto_forensicate import macdisk
from auto_forensicate.recipes import base
from auto_forensicate.ux import cli
from auto_forensicate.ux import gui
        the system's (ie: removable media).
      names(list(str)): list of disk names (eg: ['sda', 'sdc']) to acquire.
    Returns:
      list(DiskArtifact): a sorted (and curated) list of disks to acquire.
    """
    disk_list = []
    if self._platform == 'darwin':
      disk_list = self._ListAllDisksMac()
    else:
      disk_list = self._ListAllDisksLinux()

    # We order the list by size, descending.
    disk_list = sorted(disk_list, reverse=True, key=lambda disk: disk.size)
    if names:
      return [disk for disk in disk_list if disk.name in names]
    if not all_devices:
      # We resort to guessing
      return [disk for disk in disk_list if disk.ProbablyADisk()]
    return disk_list

  def _GetListDisksArtifact(self):
    """Generates a StringArtifact containing information about all disks.

    Returns:
      StringArtifact: the artifact.
    """
    if self._platform == 'darwin':
      #pylint: disable=protected-access
      diskutil_artifact = base.StringArtifact(
          'Disks/diskutil.txt', json.dumps(

# Path: auto_forensicate/errors.py
# class BadConfigOption(Exception):
# class ForensicateError(Exception):
# class RecipeException(Exception):
# class RetryableError(ForensicateError):
# 
# Path: auto_forensicate/hostinfo.py
# def ReadDMI(name):
# def GetChassisSerial():
# def GetMachineUUID():
# def GetRandomUUID():
# def GetIdentifier():
# def GetUdevadmInfo(device_name):
# def GetTime():
# def Which(cmd):
# 
# Path: auto_forensicate/macdisk.py
# class MacDiskError(Exception):
# class Disk(object):
# def _DictFromSubprocess(command):
# def _DictFromDiskutilInfo(deviceid):
# def _DictFromDiskutilList():
# def WholeDisks():
#   def __init__(self, deviceid):
#   def Refresh(self):
# 
# Path: auto_forensicate/recipes/base.py
# class BaseArtifact(object):
# class StringArtifact(BaseArtifact):
# class FileArtifact(BaseArtifact):
# class ProcessOutputArtifact(BaseArtifact):
# class BaseRecipe(object):
#   def __init__(self, name):
#   def _GetStream(self):
#   def CloseStream(self):
#   def OpenStream(self):
#   def size(self):
#   def readable_size(self):
#   def __init__(self, path, string_content):
#   def _GetStream(self):
#   def CloseStream(self):
#   def __init__(self, path):
#   def _GetStream(self):
#   def __init__(self, command, path, ignore_failure=False):
#   def _RunCommand(self):
#   def _GetStream(self):
#   def __init__(self, name, options=None):
#   def __enter__(self):
#   def __exit__(self, exc_type, exc_value, traceback):
#   def GetArtifacts(self):
# 
# Path: auto_forensicate/ux/cli.py
# def AskText(message, mandatory=False):
# def AskDiskList(disk_list):
# def Confirm(text, default='N'):
# 
# Path: auto_forensicate/ux/gui.py
# def AskText(message, mandatory=False):
# def AskDiskList(disk_list):
# def Confirm(text):


# Path: auto_forensicate/recipes/disk.py
import json
import os
import subprocess
from auto_forensicate import errors
from auto_forensicate import hostinfo
from auto_forensicate import macdisk
from auto_forensicate.recipes import base
from auto_forensicate.ux import cli
from auto_forensicate.ux import gui

        the system's (ie: removable media).
      names(list(str)): list of disk names (eg: ['sda', 'sdc']) to acquire.
    Returns:
      list(DiskArtifact): a sorted (and curated) list of disks to acquire.
    """
    disk_list = []
    if self._platform == 'darwin':
      disk_list = self._ListAllDisksMac()
    else:
      disk_list = self._ListAllDisksLinux()

    # We order the list by size, descending.
    disk_list = sorted(disk_list, reverse=True, key=lambda disk: disk.size)
    if names:
      return [disk for disk in disk_list if disk.name in names]
    if not all_devices:
      # We resort to guessing
      return [disk for disk in disk_list if disk.ProbablyADisk()]
    return disk_list

  def _GetListDisksArtifact(self):
    """Generates a StringArtifact containing information about all disks.

    Returns:
      StringArtifact: the artifact.
    """
    if self._platform == 'darwin':
      #pylint: disable=protected-access
      diskutil_artifact = base.StringArtifact(
          'Disks/diskutil.txt', json.dumps(

              [md._attributes for md in macdisk.WholeDisks()]))