(self)
| 38 | self._last_flush_time = time.time() |
| 39 | |
| 40 | def _get_cursor(self): |
| 41 | threadData = getCurrentThreadData() |
| 42 | |
| 43 | if threadData.hashDBCursor is None: |
| 44 | try: |
| 45 | connection = sqlite3.connect(self.filepath, timeout=10, isolation_level=None, check_same_thread=False) |
| 46 | self._connections.append(connection) |
| 47 | threadData.hashDBCursor = connection.cursor() |
| 48 | threadData.hashDBCursor.execute("CREATE TABLE IF NOT EXISTS storage (id INTEGER PRIMARY KEY, value TEXT)") |
| 49 | connection.commit() |
| 50 | except Exception as ex: |
| 51 | errMsg = "error occurred while opening a session " |
| 52 | errMsg += "file '%s' ('%s')" % (self.filepath, getSafeExString(ex)) |
| 53 | raise SqlmapConnectionException(errMsg) |
| 54 | |
| 55 | return threadData.hashDBCursor |
| 56 | |
| 57 | def _set_cursor(self, cursor): |
| 58 | threadData = getCurrentThreadData() |
nothing calls this directly
no test coverage detected