LEFT | RIGHT |
1 # -*- coding: utf-8 -*- | 1 # -*- coding: utf-8 -*- |
2 """The storage interface classes.""" | 2 """The storage interface classes.""" |
3 | 3 |
4 import abc | 4 import abc |
5 import os | 5 import os |
6 import shutil | 6 import shutil |
7 import tempfile | 7 import tempfile |
8 | 8 |
9 from plaso.lib import definitions | 9 from plaso.lib import definitions |
10 from plaso.serializer import json_serializer | 10 from plaso.serializer import json_serializer |
(...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
889 def Open(self): | 889 def Open(self): |
890 """Opens the storage writer.""" | 890 """Opens the storage writer.""" |
891 | 891 |
892 def PrepareMergeTaskStorage(self, unused_task): | 892 def PrepareMergeTaskStorage(self, unused_task): |
893 """Prepares a task storage for merging. | 893 """Prepares a task storage for merging. |
894 | 894 |
895 Args: | 895 Args: |
896 task (Task): task. | 896 task (Task): task. |
897 | 897 |
898 Raises: | 898 Raises: |
899 IOError: if the storage type is not supported or | 899 NotImplementedError: since there is no implementation. |
900 if the temporary path for the task storage does no exist. | |
901 """ | 900 """ |
902 raise NotImplementedError() | 901 raise NotImplementedError() |
903 | 902 |
904 @abc.abstractmethod | 903 @abc.abstractmethod |
905 def ReadPreprocessingInformation(self, knowledge_base): | 904 def ReadPreprocessingInformation(self, knowledge_base): |
906 """Reads preprocessing information. | 905 """Reads preprocessing information. |
907 | 906 |
908 The preprocessing information contains the system configuration which | 907 The preprocessing information contains the system configuration which |
909 contains information about various system specific configuration data, | 908 contains information about various system specific configuration data, |
910 for example the user accounts. | 909 for example the user accounts. |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1502 IOError: if the storage type is not supported or | 1501 IOError: if the storage type is not supported or |
1503 when the storage writer is closed. | 1502 when the storage writer is closed. |
1504 """ | 1503 """ |
1505 self._RaiseIfNotWritable() | 1504 self._RaiseIfNotWritable() |
1506 | 1505 |
1507 if self._storage_type != definitions.STORAGE_TYPE_TASK: | 1506 if self._storage_type != definitions.STORAGE_TYPE_TASK: |
1508 raise IOError(u'Unsupported storage type.') | 1507 raise IOError(u'Unsupported storage type.') |
1509 | 1508 |
1510 task_start = self._task.CreateTaskStart() | 1509 task_start = self._task.CreateTaskStart() |
1511 self._storage_file.WriteTaskStart(task_start) | 1510 self._storage_file.WriteTaskStart(task_start) |
LEFT | RIGHT |