Index: plaso/cli/image_export_tool.py |
diff --git a/tools/image_export.py b/plaso/cli/image_export_tool.py |
old mode 100755 |
new mode 100644 |
similarity index 90% |
copy from tools/image_export.py |
copy to plaso/cli/image_export_tool.py |
index f1db1cfa25bfc974200da69dc64c9b3310b7cbec..86961a547c8e88906a9474894c98559568b3e2d8 |
--- a/tools/image_export.py |
+++ b/plaso/cli/image_export_tool.py |
@@ -1,11 +1,9 @@ |
-#!/usr/bin/python |
# -*- coding: utf-8 -*- |
-"""The image export front-end.""" |
+"""The image export CLI tool.""" |
import argparse |
import logging |
import os |
-import sys |
import textwrap |
from plaso.cli import storage_media_tool |
@@ -279,48 +277,3 @@ class ImageExportTool(storage_media_tool.StorageMediaTool): |
self._output_writer.Write(u'Export completed.\n') |
self._output_writer.Write(u'\n') |
- |
- |
-def Main(): |
- """The main function.""" |
- tool = ImageExportTool() |
- |
- if not tool.ParseArguments(): |
- return False |
- |
- if tool.list_signature_identifiers: |
- tool.ListSignatureIdentifiers() |
- return True |
- |
- if not tool.has_filters: |
- logging.warning(u'No filter defined exporting all files.') |
- |
- # TODO: print more status information like PrintOptions. |
- tool.PrintFilterCollection() |
- |
- try: |
- tool.ProcessSources() |
- |
- except (KeyboardInterrupt, errors.UserAbort): |
- logging.warning(u'Aborted by user.') |
- return False |
- |
- except errors.BadConfigOption as exception: |
- logging.warning(exception) |
- return False |
- |
- except errors.SourceScannerError as exception: |
- logging.warning(( |
- u'Unable to scan for a supported filesystem with error: {0:s}\n' |
- u'Most likely the image format is not supported by the ' |
- u'tool.').format(exception)) |
- return False |
- |
- return True |
- |
- |
-if __name__ == '__main__': |
- if not Main(): |
- sys.exit(1) |
- else: |
- sys.exit(0) |