LEFT | RIGHT |
1 # -*- coding: utf-8 -*- | 1 # -*- coding: utf-8 -*- |
2 """SQLite-based storage.""" | 2 """SQLite-based storage.""" |
3 | 3 |
4 import logging | 4 import logging |
5 import os | 5 import os |
6 import sqlite3 | 6 import sqlite3 |
7 import zlib | 7 import zlib |
8 | 8 |
9 from plaso.containers import sessions | 9 from plaso.containers import sessions |
10 from plaso.lib import definitions | 10 from plaso.lib import definitions |
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
591 | 591 |
592 Returns: | 592 Returns: |
593 bool: True if the storage contains event tags. | 593 bool: True if the storage contains event tags. |
594 """ | 594 """ |
595 query = u'SELECT COUNT(*) FROM event_tags' | 595 query = u'SELECT COUNT(*) FROM event_tags' |
596 self._cursor.execute(query) | 596 self._cursor.execute(query) |
597 | 597 |
598 row = self._cursor.fetchone() | 598 row = self._cursor.fetchone() |
599 return row and row[0] != 0 | 599 return row and row[0] != 0 |
600 | 600 |
| 601 # pylint: disable=arguments-differ |
601 def Open(self, path=None, read_only=True, **unused_kwargs): | 602 def Open(self, path=None, read_only=True, **unused_kwargs): |
602 """Opens the storage. | 603 """Opens the storage. |
603 | 604 |
604 Args: | 605 Args: |
605 path (Optional[str]): path to the storage file. | 606 path (Optional[str]): path to the storage file. |
606 read_only (Optional[bool]): True if the file should be opened in | 607 read_only (Optional[bool]): True if the file should be opened in |
607 read-only mode. | 608 read-only mode. |
608 | 609 |
609 Raises: | 610 Raises: |
610 IOError: if the storage file is already opened or if the database | 611 IOError: if the storage file is already opened or if the database |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
907 Args: | 908 Args: |
908 path (str): path to the storage file. | 909 path (str): path to the storage file. |
909 task (Task): task. | 910 task (Task): task. |
910 | 911 |
911 Returns: | 912 Returns: |
912 SQLiteStorageFileWriter: storage writer. | 913 SQLiteStorageFileWriter: storage writer. |
913 """ | 914 """ |
914 return SQLiteStorageFileWriter( | 915 return SQLiteStorageFileWriter( |
915 self._session, path, | 916 self._session, path, |
916 storage_type=definitions.STORAGE_TYPE_TASK, task=task) | 917 storage_type=definitions.STORAGE_TYPE_TASK, task=task) |
LEFT | RIGHT |