LEFT | RIGHT |
1 # -*- coding: utf-8 -*- | 1 # -*- coding: utf-8 -*- |
2 """The processing engine.""" | 2 """The processing engine.""" |
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.lib import errors as dfvfs_errors | 7 from dfvfs.lib import errors as dfvfs_errors |
8 from dfvfs.path import factory as path_spec_factory | 8 from dfvfs.path import factory as path_spec_factory |
9 from dfvfs.resolver import resolver as path_spec_resolver | 9 from dfvfs.resolver import resolver as path_spec_resolver |
10 | 10 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 return definitions.OPERATING_SYSTEM_MACOSX | 79 return definitions.OPERATING_SYSTEM_MACOSX |
80 | 80 |
81 if u'/etc' in locations: | 81 if u'/etc' in locations: |
82 return definitions.OPERATING_SYSTEM_LINUX | 82 return definitions.OPERATING_SYSTEM_LINUX |
83 | 83 |
84 return definitions.OPERATING_SYSTEM_UNKNOWN | 84 return definitions.OPERATING_SYSTEM_UNKNOWN |
85 | 85 |
86 @classmethod | 86 @classmethod |
87 def CreateSession( | 87 def CreateSession( |
88 cls, command_line_arguments=None, debug_mode=False, | 88 cls, command_line_arguments=None, debug_mode=False, |
89 filter_expression=None, filter_file=None, preferred_encoding=u'utf-8', | 89 filter_file=None, preferred_encoding=u'utf-8', |
90 preferred_time_zone=None, preferred_year=None): | 90 preferred_time_zone=None, preferred_year=None): |
91 """Creates a session attribute containiner. | 91 """Creates a session attribute containiner. |
92 | 92 |
93 Args: | 93 Args: |
94 command_line_arguments (Optional[str]): the command line arguments. | 94 command_line_arguments (Optional[str]): the command line arguments. |
95 debug_mode (bool): True if debug mode was enabled. | 95 debug_mode (bool): True if debug mode was enabled. |
96 filter_expression (str): expression to filter events. | |
97 filter_file (Optional[str]): path to a file with find specifications. | 96 filter_file (Optional[str]): path to a file with find specifications. |
98 preferred_encoding (Optional[str]): preferred encoding. | 97 preferred_encoding (Optional[str]): preferred encoding. |
99 preferred_time_zone (Optional[str]): preferred time zone. | 98 preferred_time_zone (Optional[str]): preferred time zone. |
100 preferred_year (Optional[int]): preferred year. | 99 preferred_year (Optional[int]): preferred year. |
101 | 100 |
102 Returns: | 101 Returns: |
103 Session: session attribute container. | 102 Session: session attribute container. |
104 """ | 103 """ |
105 session = sessions.Session() | 104 session = sessions.Session() |
106 | 105 |
107 session.command_line_arguments = command_line_arguments | 106 session.command_line_arguments = command_line_arguments |
108 session.debug_mode = debug_mode | 107 session.debug_mode = debug_mode |
109 session.filter_expression = filter_expression | |
110 session.filter_file = filter_file | 108 session.filter_file = filter_file |
111 session.preferred_encoding = preferred_encoding | 109 session.preferred_encoding = preferred_encoding |
112 session.preferred_time_zone = preferred_time_zone | 110 session.preferred_time_zone = preferred_time_zone |
113 session.preferred_year = preferred_year | 111 session.preferred_year = preferred_year |
114 | 112 |
115 return session | 113 return session |
116 | 114 |
117 def GetSourceFileSystem(self, source_path_spec, resolver_context=None): | 115 def GetSourceFileSystem(self, source_path_spec, resolver_context=None): |
118 """Retrieves the file system of the source. | 116 """Retrieves the file system of the source. |
119 | 117 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 self.knowledge_base.platform = platforms[0] | 187 self.knowledge_base.platform = platforms[0] |
190 | 188 |
191 @classmethod | 189 @classmethod |
192 def SupportsGuppyMemoryProfiling(cls): | 190 def SupportsGuppyMemoryProfiling(cls): |
193 """Determines if memory profiling with guppy is supported. | 191 """Determines if memory profiling with guppy is supported. |
194 | 192 |
195 Returns: | 193 Returns: |
196 bool: True if memory profiling with guppy is supported. | 194 bool: True if memory profiling with guppy is supported. |
197 """ | 195 """ |
198 return profiler.GuppyMemoryProfiler.IsSupported() | 196 return profiler.GuppyMemoryProfiler.IsSupported() |
LEFT | RIGHT |