OLD | NEW |
1 # -*- coding: utf-8 -*- | 1 # -*- coding: utf-8 -*- |
2 """This file contains the output manager class.""" | 2 """This file contains the output manager class.""" |
3 | 3 |
4 from plaso.lib import py2to3 | 4 from plaso.lib import py2to3 |
5 | 5 |
6 | 6 |
7 class OutputManager(object): | 7 class OutputManager(object): |
8 """Class that implements the output manager.""" | 8 """Class that implements the output manager.""" |
9 | 9 |
10 _disabled_output_classes = {} | 10 _disabled_output_classes = {} |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 raise KeyError( | 68 raise KeyError( |
69 u'Name: [{0:s}] not registered as an output module.'.format(name)) | 69 u'Name: [{0:s}] not registered as an output module.'.format(name)) |
70 | 70 |
71 return cls._output_classes[name] | 71 return cls._output_classes[name] |
72 | 72 |
73 @classmethod | 73 @classmethod |
74 def GetOutputClasses(cls): | 74 def GetOutputClasses(cls): |
75 """Retrieves the available output classes its associated name. | 75 """Retrieves the available output classes its associated name. |
76 | 76 |
77 Yields: | 77 Yields: |
78 A tuple of output class name and type object (subclass of OutputModule). | 78 tuple[str, type]: output class name and type object. |
79 """ | 79 """ |
80 for _, output_class in iter(cls._output_classes.items()): | 80 for _, output_class in iter(cls._output_classes.items()): |
81 yield output_class.NAME, output_class | 81 yield output_class.NAME, output_class |
82 | 82 |
83 @classmethod | 83 @classmethod |
84 def HasOutputClass(cls, name): | 84 def HasOutputClass(cls, name): |
85 """Determines if a specific output class is registered with the manager. | 85 """Determines if a specific output class is registered with the manager. |
86 | 86 |
87 Args: | 87 Args: |
88 name: The name of the output module. | 88 name: The name of the output module. |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 OutputModule). | 155 OutputModule). |
156 disabled: boolean determining whether the output module is | 156 disabled: boolean determining whether the output module is |
157 disabled due to the module not loading correctly or | 157 disabled due to the module not loading correctly or |
158 not. Defaults to False. | 158 not. Defaults to False. |
159 | 159 |
160 Raises: | 160 Raises: |
161 KeyError: if output class is already set for the corresponding name. | 161 KeyError: if output class is already set for the corresponding name. |
162 """ | 162 """ |
163 for output_class in output_classes: | 163 for output_class in output_classes: |
164 cls.RegisterOutput(output_class, disabled) | 164 cls.RegisterOutput(output_class, disabled) |
OLD | NEW |