LEFT | RIGHT |
1 # -*- coding: utf-8 -*- | 1 # -*- coding: utf-8 -*- |
2 """The preprocess plugins manager.""" | 2 """The preprocess plugins manager.""" |
3 | 3 |
4 import logging | 4 import logging |
5 | 5 |
6 from dfvfs.helpers import file_system_searcher | 6 from dfvfs.helpers import file_system_searcher |
7 from dfvfs.helpers import windows_path_resolver | 7 from dfvfs.helpers import windows_path_resolver |
8 from dfwinreg import interface as dfwinreg_interface | 8 from dfwinreg import interface as dfwinreg_interface |
9 from dfwinreg import regf as dfwinreg_regf | 9 from dfwinreg import regf as dfwinreg_regf |
10 from dfwinreg import registry as dfwinreg_registry | 10 from dfwinreg import registry as dfwinreg_registry |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 | 197 |
198 del cls._plugins[name] | 198 del cls._plugins[name] |
199 | 199 |
200 if name in cls._file_system_plugins: | 200 if name in cls._file_system_plugins: |
201 del cls._file_system_plugins[name] | 201 del cls._file_system_plugins[name] |
202 | 202 |
203 if name in cls._registry_value_plugins: | 203 if name in cls._registry_value_plugins: |
204 del cls._registry_value_plugins[name] | 204 del cls._registry_value_plugins[name] |
205 | 205 |
206 @classmethod | 206 @classmethod |
| 207 def GetNames(cls): |
| 208 """Retrieves the names of the registered artifact definitions. |
| 209 |
| 210 Returns: |
| 211 list[str]: registered artifact definitions names. |
| 212 """ |
| 213 return [ |
| 214 plugin_class.ARTIFACT_DEFINITION_NAME |
| 215 for plugin_class in cls._plugins.values()] |
| 216 |
| 217 @classmethod |
207 def RegisterPlugin(cls, plugin_class): | 218 def RegisterPlugin(cls, plugin_class): |
208 """Registers an preprocess plugin class. | 219 """Registers an preprocess plugin class. |
209 | 220 |
210 Args: | 221 Args: |
211 plugin_class (type): preprocess plugin class. | 222 plugin_class (type): preprocess plugin class. |
212 | 223 |
213 Raises: | 224 Raises: |
214 KeyError: if plugin class is already set for the corresponding name. | 225 KeyError: if plugin class is already set for the corresponding name. |
215 TypeError: if the source type of the plugin class is not supported. | 226 TypeError: if the source type of the plugin class is not supported. |
216 """ | 227 """ |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 win_registry = dfwinreg_registry.WinRegistry( | 286 win_registry = dfwinreg_registry.WinRegistry( |
276 registry_file_reader=registry_file_reader) | 287 registry_file_reader=registry_file_reader) |
277 | 288 |
278 searcher = registry_searcher.WinRegistrySearcher(win_registry) | 289 searcher = registry_searcher.WinRegistrySearcher(win_registry) |
279 | 290 |
280 cls.CollectFromWindowsRegistry( | 291 cls.CollectFromWindowsRegistry( |
281 artifacts_registry, knowledge_base, searcher) | 292 artifacts_registry, knowledge_base, searcher) |
282 | 293 |
283 if not knowledge_base.HasUserAccounts(): | 294 if not knowledge_base.HasUserAccounts(): |
284 logging.warning(u'Unable to find any user accounts on the system.') | 295 logging.warning(u'Unable to find any user accounts on the system.') |
LEFT | RIGHT |