1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2026-01-22 14:41:39 +00:00

Add shelve-based picture cache implementation

Hopefully, this will fix #394 for real this time, that is, without the
need for a messy python executable ship in the app.
This commit is contained in:
Virgil Dupras
2016-11-15 19:58:18 -05:00
parent f7adb5f11e
commit c58a4817ca
7 changed files with 162 additions and 11 deletions

View File

@@ -12,9 +12,10 @@ import sqlite3 as sqlite
from .cache import string_to_colors, colors_to_string
class SqliteCache:
"""A class to cache picture blocks.
"""A class to cache picture blocks in a sqlite backend.
"""
def __init__(self, db=':memory:'):
def __init__(self, db=':memory:', readonly=False):
# readonly is not used in the sqlite version of the cache
self.dbname = db
self.con = None
self._create_con()