diff options
author | Mattias Andrée <maandree@operamail.com> | 2012-08-20 18:53:00 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2012-08-20 18:53:00 +0200 |
commit | 908616bcea3acaa34ad6b10b28e489189bb689db (patch) | |
tree | e53166a9e2c1fea9f16a25036dd096d6578f7151 /ponysay | |
parent | 22963aebbc071fb26a3a4c8e492d99c4289ac5d9 (diff) | |
download | ponysay-908616bcea3acaa34ad6b10b28e489189bb689db.tar.gz ponysay-908616bcea3acaa34ad6b10b28e489189bb689db.tar.bz2 ponysay-908616bcea3acaa34ad6b10b28e489189bb689db.zip |
private cache
Diffstat (limited to 'ponysay')
-rwxr-xr-x | ponysay | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -452,11 +452,17 @@ class Ponysay(): palette = env_kms palettefile = env_kms.replace('\033]P', '') - kmsponies = '/var/cache/ponysay/kmsponies/' + palettefile + cachedir = '/var/cache/ponysay' + if not os.path.isdir(cachedir): + cachedir = HOME + '/.cache/ponysay' + if not os.path.isdir(cachedir): + os.makedirs(cachedir) + + kmsponies = cachedir + '/kmsponies/' + palettefile kmspony = (kmsponies + pony).replace('//', '/') if not os.path.isfile(kmspony): - protokmsponies = '/var/cache/ponysay/protokmsponies/' + protokmsponies = cachedir + '/protokmsponies/' protokmspony = (protokmsponies + pony).replace('//', '/') protokmsponydir = protokmspony[:protokmspony.rindex('/')] |