Verified Commit 12efa2aa authored by Antoine Beaupré's avatar Antoine Beaupré
Browse files

default to data directory and add a deprecation warning

Closes: #17
parent 59709a08
Loading
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -297,10 +297,15 @@ class SqliteStorage(object):
    def guess_path(cls):
        cache_home_db = os.path.join(xdg_base_dirs.xdg_cache_home, 'feed2exec.db')
        data_home_db = os.path.join(xdg_base_dirs.xdg_data_home, 'feed2exec.db')
        if os.path.exists(cache_home_db):
            return cache_home_db
        else:
        if os.path.exists(data_home_db):
            return data_home_db
        else:
            logging.warning(
                "falling back on deprecated cache directory, move %s to %s to remove this warning",
                cache_home_db,
                data_home_db,
            )
            return cache_home_db

    def get(self, key):
        with self.connection(commit=False) as con: