Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(19)

Unified Diff: plaso/cli/image_export_tool.py

Issue 321000043: [plaso] Refactored log2timeline front-end to tool #160 (Closed)
Patch Set: Changes after review Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « plaso/cli/extraction_tool.py ('k') | plaso/cli/log2timeline_tool.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « plaso/cli/extraction_tool.py ('k') | plaso/cli/log2timeline_tool.py » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b