From 84107bdd772255e735584b330d8521f52513ac28 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Wed, 4 Jul 2018 12:33:23 +0200 Subject: Factorise retrieving tmp_image_dir. --- poezio/config.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'poezio/config.py') diff --git a/poezio/config.py b/poezio/config.py index 8549df71..5b99b293 100644 --- a/poezio/config.py +++ b/poezio/config.py @@ -507,6 +507,15 @@ def file_ok(filepath): return bool(val) +def get_image_cache(): + if not config.get('extract_inline_images'): + return None + tmp_dir = config.get('tmp_image_dir') + if tmp_dir: + return Path(tmp_dir) + return xdg.CACHE_HOME / 'images' + + def check_create_cache_dir(): """ create the cache directory if it doesn't exist -- cgit v1.2.3