Skip to content

Commit

Permalink
Code review: 231170043: Initial version of pinfo compare option.
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimmetz committed Dec 31, 2015
1 parent fb0b202 commit ccaf5d6
Show file tree
Hide file tree
Showing 8 changed files with 480 additions and 128 deletions.
2 changes: 1 addition & 1 deletion config/dpkg/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ python-plaso (1.2.1-1) unstable; urgency=low

* Auto-generated

-- Log2Timeline <[email protected]> Mon, 27 Apr 2015 06:27:27 +0200
-- Log2Timeline <[email protected]> Sat, 02 May 2015 10:45:35 +0200
2 changes: 1 addition & 1 deletion plaso/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
__version__ = '1.2.1'

VERSION_DEV = True
VERSION_DATE = '20150427'
VERSION_DATE = '20150502'


def GetVersion():
Expand Down
26 changes: 18 additions & 8 deletions plaso/cli/analysis_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,23 @@ def __init__(self, input_reader=None, output_writer=None):
input_reader=input_reader, output_writer=output_writer)
self._storage_file_path = None

def _ParseStorageFileOptions(self, options):
"""Parses the storage file options.
Args:
options: the command line arguments (instance of argparse.Namespace).
Raises:
BadConfigOption: if the options are invalid.
"""
self._storage_file_path = getattr(options, u'storage_file', None)
if not self._storage_file_path:
raise errors.BadConfigOption(u'Missing storage file option.')

if not os.path.isfile(self._storage_file_path):
raise errors.BadConfigOption(
u'No such storage file: {0:s}.'.format(self._storage_file_path))

def AddStorageFileOptions(self, argument_group):
"""Adds the storage file options to the argument group.
Expand All @@ -47,11 +64,4 @@ def ParseOptions(self, options):
BadConfigOption: if the options are invalid.
"""
super(AnalysisTool, self).ParseOptions(options)

self._storage_file_path = getattr(options, u'storage_file', None)
if not self._storage_file_path:
raise errors.BadConfigOption(u'Missing storage file option.')

if not os.path.isfile(self._storage_file_path):
raise errors.BadConfigOption(
u'No such storage file {0:s}.'.format(self._storage_file_path))
self._ParseStorageFileOptions(options)
2 changes: 1 addition & 1 deletion plaso/cli/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def AddBasicOptions(self, argument_group):
u'Show this help message and exit.'))

argument_group.add_argument(
u'-v', u'--version', dest=u'version', action=u'version',
u'-V', u'--version', dest=u'version', action=u'version',
version=version_string, help=u'Show the current version.')

def ParseOptions(self, unused_options):
Expand Down
3 changes: 3 additions & 0 deletions plaso/lib/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -1328,6 +1328,9 @@ def StoreReport(self, analysis_report):
def GetReports(self):
"""Read in all stored analysis reports from storage and yield them.
Yields:
Analysis reports (instances of AnalysisReport).
Raises:
IOError: if the stream cannot be opened.
"""
Expand Down
Binary file added test_data/pinfo_test.out
Binary file not shown.
Loading

0 comments on commit ccaf5d6

Please sign in to comment.