# Path: auto_forensicate/errors.py
# class BadConfigOption(Exception):
# class ForensicateError(Exception):
# class RecipeException(Exception):
# class RetryableError(ForensicateError):
# 
# 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 os
import subprocess
from auto_forensicate import errors
from auto_forensicate.recipes import base
from auto_forensicate.ux import cli
from auto_forensicate.ux import gui
            'Specify the path to the directory you wish to copy')
        if not os.path.isdir(path):
          print(
              'The following path does not exist or is not a directory:'
              '{0:s}'.format(path))
          continue
        path_list.append(path)
        more_to_copy = cli.Confirm('Do you wish to copy another folder?')
      else:
        path = gui.AskText(
            'Specify the path to the directory you wish to copy')
        if not os.path.isdir(path):
          # TODO: display an GUI error message
          continue
        path_list.append(path)
        more_to_copy = gui.Confirm('Do you wish to copy another folder?')

    if not path_list:
      raise errors.RecipeException('No directory to collect')

    artifacts = []
    # Deduplicating paths, as they would cause the code to upload the same file
    # multiple times, which might not be allowed by the uploading process.
    for directory in  list(set(path_list)):

      # 'tar' will not save some metadata such as access time. We generate
      # a 'timeline' with the find(1) command to keep this information
      timeline_artifact = None
      dir_artifact = None
      if self._platform == 'darwin':

# Path: auto_forensicate/errors.py
# class BadConfigOption(Exception):
# class ForensicateError(Exception):
# class RecipeException(Exception):
# class RetryableError(ForensicateError):
# 
# 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/directory.py
import os
import subprocess
from auto_forensicate import errors
from auto_forensicate.recipes import base
from auto_forensicate.ux import cli
from auto_forensicate.ux import gui

            'Specify the path to the directory you wish to copy')
        if not os.path.isdir(path):
          print(
              'The following path does not exist or is not a directory:'
              '{0:s}'.format(path))
          continue
        path_list.append(path)
        more_to_copy = cli.Confirm('Do you wish to copy another folder?')
      else:
        path = gui.AskText(
            'Specify the path to the directory you wish to copy')
        if not os.path.isdir(path):
          # TODO: display an GUI error message
          continue
        path_list.append(path)
        more_to_copy = gui.Confirm('Do you wish to copy another folder?')

    if not path_list:
      raise errors.RecipeException('No directory to collect')

    artifacts = []
    # Deduplicating paths, as they would cause the code to upload the same file
    # multiple times, which might not be allowed by the uploading process.
    for directory in  list(set(path_list)):

      # 'tar' will not save some metadata such as access time. We generate
      # a 'timeline' with the find(1) command to keep this information
      timeline_artifact = None
      dir_artifact = None
      if self._platform == 'darwin':

        timeline_artifact = base.ProcessOutputArtifact(