# 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

    #pylint: disable=protected-access
    udevadm_artifact = base.StringArtifact(
        'Disks/{0:s}.udevadm.txt'.format(disk.name),
        disk._GetUdevadmProperty('udevadm_text_output'))
    return udevadm_artifact

  def GetArtifacts(self):
    """Selects the Artifacts to acquire.

    This tries to return as many Artifacts as possible even if some collection
    raised an exception.

    Returns:
      list(DiskArtifact): the artifacts corresponding to copy.

    Raises:
      errors.RecipeException: when no disk is to be collected.
    """
    artifacts = []
    disks_to_collect = []
    if getattr(self._options, 'disable_dcfldd', None):
      self._logger.info('Disabling dcfldd')
      self.use_dcfldd = False

    if getattr(self._options, 'select_disks', None):
      all_disks = self._ListDisks(all_devices=True)
      if getattr(self._options, 'no_zenity', False):
        disks_to_collect = cli.AskDiskList(all_disks)
      else:

# 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


    #pylint: disable=protected-access
    udevadm_artifact = base.StringArtifact(
        'Disks/{0:s}.udevadm.txt'.format(disk.name),
        disk._GetUdevadmProperty('udevadm_text_output'))
    return udevadm_artifact

  def GetArtifacts(self):
    """Selects the Artifacts to acquire.

    This tries to return as many Artifacts as possible even if some collection
    raised an exception.

    Returns:
      list(DiskArtifact): the artifacts corresponding to copy.

    Raises:
      errors.RecipeException: when no disk is to be collected.
    """
    artifacts = []
    disks_to_collect = []
    if getattr(self._options, 'disable_dcfldd', None):
      self._logger.info('Disabling dcfldd')
      self.use_dcfldd = False

    if getattr(self._options, 'select_disks', None):
      all_disks = self._ListDisks(all_devices=True)
      if getattr(self._options, 'no_zenity', False):
        disks_to_collect = cli.AskDiskList(all_disks)
      else:

        disks_to_collect = gui.AskDiskList(all_disks)