OLD | NEW |
1 # -*- coding: utf-8 -*- | 1 # -*- coding: utf-8 -*- |
2 """The StatusView CLI tool.""" | 2 """The StatusView CLI tool.""" |
3 | 3 |
4 import sys | 4 import sys |
5 | 5 |
6 try: | 6 try: |
7 import win32console | 7 import win32console |
8 except ImportError: | 8 except ImportError: |
9 win32console = None | 9 win32console = None |
10 | 10 |
11 import plaso | 11 import plaso |
12 | 12 |
13 from plaso.lib import definitions | 13 from plaso.lib import definitions |
14 from plaso.cli import storage_media_tool | 14 from plaso.cli import storage_media_tool |
15 from plaso.cli import tools as cli_tools | 15 from plaso.cli import tools as cli_tools |
16 from plaso.cli import views as cli_views | 16 from plaso.cli import views as cli_views |
17 | 17 |
18 | 18 |
19 class StatusViewTool(storage_media_tool.StorageMediaTool): | 19 class StatusViewTool(storage_media_tool.StorageMediaTool): |
20 """A tool that reports extraction status.""" | 20 """A tool that reports processing status.""" |
21 | 21 |
22 def __init__(self, input_reader=None, output_writer=None): | 22 def __init__(self, input_reader=None, output_writer=None): |
23 """Initializes the status view tool object. | 23 """Initializes the status view tool object. |
24 | 24 |
25 Args: | 25 Args: |
26 input_reader (Optional[InputReader]): input reader, where None indicates | 26 input_reader (Optional[InputReader]): input reader, where None indicates |
27 that the stdin input reader should be used. | 27 that the stdin input reader should be used. |
28 output_writer (Optional[OutputWriter]): output writer, where None | 28 output_writer (Optional[OutputWriter]): output writer, where None |
29 indicates that the stdout output writer should be used. | 29 indicates that the stdout output writer should be used. |
30 """ | 30 """ |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 if index + 1 <= self._number_of_analysis_reports: | 190 if index + 1 <= self._number_of_analysis_reports: |
191 continue | 191 continue |
192 | 192 |
193 title = u'Analysis report: {0:d}'.format(index) | 193 title = u'Analysis report: {0:d}'.format(index) |
194 table_view = cli_views.ViewsFactory.GetTableView( | 194 table_view = cli_views.ViewsFactory.GetTableView( |
195 self._views_format_type, title=title) | 195 self._views_format_type, title=title) |
196 | 196 |
197 table_view.AddRow([u'String', analysis_report.GetString()]) | 197 table_view.AddRow([u'String', analysis_report.GetString()]) |
198 | 198 |
199 table_view.Write(self._output_writer) | 199 table_view.Write(self._output_writer) |
200 | |
201 def SetSourcePath(self, path): | |
202 """Set the path of the source to process. | |
203 | |
204 Args: | |
205 path (str): the path to the source. | |
206 """ | |
207 self._source_path = path | |
OLD | NEW |