add fallback for missing save_cache_path

python-xdg on sle11 lacks save_cache_path so add fallback. Needed for
changelog-checker which runs on sle11 atm.
This commit is contained in:
Ludwig Nussel 2015-06-09 08:55:14 +02:00
parent 710ac59ba1
commit bc9cce65dd

View File

@ -25,7 +25,16 @@ except:
import pickle
from xdg.BaseDirectory import save_cache_path
try:
from xdg.BaseDirectory import save_cache_path
except ImportError:
from xdg.BaseDirectory import xdg_cache_home
def save_cache_path(*name):
path = os.path.join(xdg_cache_home, *name)
if not os.path.isdir(path):
os.makedirs(path)
return path
# Where the cache files are stored
CACHEDIR = save_cache_path('opensuse-repo-checker')