OLD | NEW |
1 # -*- coding: utf-8 -*- | 1 # -*- coding: utf-8 -*- |
2 """The event extraction worker.""" | 2 """The event extraction worker.""" |
3 | 3 |
4 import copy | 4 import copy |
5 import logging | 5 import logging |
6 import os | 6 import os |
7 import re | 7 import re |
8 import time | 8 import time |
9 | 9 |
10 from dfvfs.analyzer import analyzer | 10 from dfvfs.analyzer import analyzer |
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 | 714 |
715 analyzer_object = analyzers_manager.AnalyzersManager.GetAnalyzerInstance( | 715 analyzer_object = analyzers_manager.AnalyzersManager.GetAnalyzerInstance( |
716 u'hashing') | 716 u'hashing') |
717 analyzer_object.SetHasherNames(hasher_names_string) | 717 analyzer_object.SetHasherNames(hasher_names_string) |
718 self._analyzers.append(analyzer_object) | 718 self._analyzers.append(analyzer_object) |
719 | 719 |
720 def _SetYaraRules(self, yara_rules_string): | 720 def _SetYaraRules(self, yara_rules_string): |
721 """Sets the Yara rules. | 721 """Sets the Yara rules. |
722 | 722 |
723 Args: | 723 Args: |
724 yara_rules_string(str): unparsed Yara rule definitions. | 724 yara_rules_string (str): unparsed Yara rule definitions. |
725 """ | 725 """ |
726 if not yara_rules_string: | 726 if not yara_rules_string: |
727 return | 727 return |
728 | 728 |
729 analyzer_object = analyzers_manager.AnalyzersManager.GetAnalyzerInstance( | 729 analyzer_object = analyzers_manager.AnalyzersManager.GetAnalyzerInstance( |
730 u'yara') | 730 u'yara') |
731 analyzer_object.SetRules(yara_rules_string) | 731 analyzer_object.SetRules(yara_rules_string) |
732 self._analyzers.append(analyzer_object) | 732 self._analyzers.append(analyzer_object) |
733 | 733 |
734 def GetAnalyzerNames(self): | 734 def GetAnalyzerNames(self): |
735 """Gets the names of the active analyzers. | 735 """Gets the names of the active analyzers. |
736 | 736 |
737 Returns: | 737 Returns: |
738 list(str): names of active analyzers. | 738 list[str]: names of active analyzers. |
739 """ | 739 """ |
740 return [analyzer_instance.NAME for analyzer_instance in self._analyzers] | 740 return [analyzer_instance.NAME for analyzer_instance in self._analyzers] |
741 | 741 |
742 def ProcessPathSpec(self, mediator, path_spec): | 742 def ProcessPathSpec(self, mediator, path_spec): |
743 """Processes a path specification. | 743 """Processes a path specification. |
744 | 744 |
745 Args: | 745 Args: |
746 mediator (ParserMediator): mediates the interactions between | 746 mediator (ParserMediator): mediates the interactions between |
747 parsers and other components, such as storage and abort signals. | 747 parsers and other components, such as storage and abort signals. |
748 path_spec (dfvfs.PathSpec): path specification. | 748 path_spec (dfvfs.PathSpec): path specification. |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
798 """Sets the parsers profiler. | 798 """Sets the parsers profiler. |
799 | 799 |
800 Args: | 800 Args: |
801 processing_profiler (ProcessingProfiler): processing profile. | 801 processing_profiler (ProcessingProfiler): processing profile. |
802 """ | 802 """ |
803 self._processing_profiler = processing_profiler | 803 self._processing_profiler = processing_profiler |
804 | 804 |
805 def SignalAbort(self): | 805 def SignalAbort(self): |
806 """Signals the extraction worker to abort.""" | 806 """Signals the extraction worker to abort.""" |
807 self._abort = True | 807 self._abort = True |
OLD | NEW |