gsetup: Add a CACHE_DIR path
This points to the user's ~/.cache directory where Emmental can store files. Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
parent
3e73ce0650
commit
3b8fb8531e
|
@ -24,6 +24,9 @@ CSS_PRIORITY = gi.repository.Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
|
||||||
CSS_PROVIDER = gi.repository.Gtk.CssProvider()
|
CSS_PROVIDER = gi.repository.Gtk.CssProvider()
|
||||||
CSS_PROVIDER.load_from_path(str(CSS_FILE))
|
CSS_PROVIDER.load_from_path(str(CSS_FILE))
|
||||||
|
|
||||||
|
CACHE_DIR = pathlib.Path(xdg.BaseDirectory.save_cache_path("emmental"))
|
||||||
|
CACHE_DIR = CACHE_DIR / DEBUG_STR.lstrip("-")
|
||||||
|
|
||||||
DATA_DIR = pathlib.Path(xdg.BaseDirectory.save_data_path("emmental"))
|
DATA_DIR = pathlib.Path(xdg.BaseDirectory.save_data_path("emmental"))
|
||||||
|
|
||||||
RESOURCE_PATH = "/com/nowheycreamery/emmental"
|
RESOURCE_PATH = "/com/nowheycreamery/emmental"
|
||||||
|
|
|
@ -62,6 +62,12 @@ class TestGSetup(unittest.TestCase):
|
||||||
self.assertIsInstance(emmental.gsetup.RESOURCE,
|
self.assertIsInstance(emmental.gsetup.RESOURCE,
|
||||||
gi.repository.Gio.Resource)
|
gi.repository.Gio.Resource)
|
||||||
|
|
||||||
|
def test_cache_dir(self):
|
||||||
|
"""Check that the CACHE_DIR points to the right place."""
|
||||||
|
cache_path = xdg.BaseDirectory.save_cache_path("emmental")
|
||||||
|
self.assertEqual(emmental.gsetup.CACHE_DIR,
|
||||||
|
pathlib.Path(cache_path) / "debug")
|
||||||
|
|
||||||
def test_data_dir(self):
|
def test_data_dir(self):
|
||||||
"""Check that the DATA_DIR points to the right place."""
|
"""Check that the DATA_DIR points to the right place."""
|
||||||
data_path = xdg.BaseDirectory.save_data_path("emmental")
|
data_path = xdg.BaseDirectory.save_data_path("emmental")
|
||||||
|
|
Loading…
Reference in New Issue