LEFT | RIGHT |
1 # -*- coding: utf-8 -*- | 1 # -*- coding: utf-8 -*- |
2 """The SleuthKit (TSK) partition path specification implementation.""" | 2 """The SleuthKit (TSK) partition path specification implementation.""" |
3 | 3 |
4 from __future__ import unicode_literals | 4 from __future__ import unicode_literals |
5 | 5 |
6 from dfvfs.lib import definitions | 6 from dfvfs.lib import definitions |
7 from dfvfs.path import factory | 7 from dfvfs.path import factory |
8 from dfvfs.path import path_spec | 8 from dfvfs.path import path_spec |
9 | 9 |
10 | 10 |
11 class TSKPartitionPathSpec(path_spec.PathSpec): | 11 class TSKPartitionPathSpec(path_spec.PathSpec): |
12 """SleuthKit (TSK) partition path specification. | 12 """SleuthKit (TSK) partition path specification. |
13 | 13 |
14 Attributes: | 14 Attributes: |
15 location (str): location. | 15 location (str): location. |
16 part_index (int): part index. | 16 part_index (int): part index. |
17 start_offset (int): start offset. | 17 start_offset (int): start offset. |
18 """ | 18 """ |
19 | 19 |
20 TYPE_INDICATOR = definitions.TYPE_INDICATOR_TSK_PARTITION | 20 TYPE_INDICATOR = definitions.TYPE_INDICATOR_TSK_PARTITION |
21 | 21 |
22 def __init__( | 22 def __init__( |
23 self, location=None, parent=None, part_index=None, start_offset=None, | 23 self, location=None, parent=None, part_index=None, start_offset=None, |
24 **kwargs): | 24 **kwargs): |
25 """Initializes the path specification. | 25 """Initializes a path specification. |
26 | 26 |
27 Note that the TSK partition path specification must have a parent. | 27 Note that the TSK partition path specification must have a parent. |
28 | 28 |
29 Args: | 29 Args: |
30 location (Optional[str]): location. | 30 location (Optional[str]): location. |
31 parent (Optional[PathSpec]): parent path specification. | 31 parent (Optional[PathSpec]): parent path specification. |
32 part_index (Optional[int]): part index. | 32 part_index (Optional[int]): part index. |
33 start_offset (Optional[int]): start offset. | 33 start_offset (Optional[int]): start offset. |
34 | 34 |
35 Raises: | 35 Raises: |
(...skipping 16 matching lines...) Expand all Loading... |
52 string_parts.append('location: {0:s}'.format(self.location)) | 52 string_parts.append('location: {0:s}'.format(self.location)) |
53 if self.part_index is not None: | 53 if self.part_index is not None: |
54 string_parts.append('part index: {0:d}'.format(self.part_index)) | 54 string_parts.append('part index: {0:d}'.format(self.part_index)) |
55 if self.start_offset is not None: | 55 if self.start_offset is not None: |
56 string_parts.append('start offset: 0x{0:08x}'.format(self.start_offset)) | 56 string_parts.append('start offset: 0x{0:08x}'.format(self.start_offset)) |
57 | 57 |
58 return self._GetComparable(sub_comparable_string=', '.join(string_parts)) | 58 return self._GetComparable(sub_comparable_string=', '.join(string_parts)) |
59 | 59 |
60 | 60 |
61 factory.Factory.RegisterPathSpec(TSKPartitionPathSpec) | 61 factory.Factory.RegisterPathSpec(TSKPartitionPathSpec) |
LEFT | RIGHT |