[SCM] morituri/master: catch missing save_cache_path in xdg.BaseDirectory; closes #31
js at users.alioth.debian.org
js at users.alioth.debian.org
Sun Oct 19 20:10:06 UTC 2014
The following commit has been merged in the master branch:
commit 02397302c6e7f79673533751839d5c6f39c9a289
Author: Thomas Vander Stichele <thomas (at) apestaart (dot) org>
Date: Sun Jul 14 09:29:17 2013 +0200
catch missing save_cache_path in xdg.BaseDirectory; closes #31
diff --git a/morituri/common/directory.py b/morituri/common/directory.py
index e076a1f..47aac11 100644
--- a/morituri/common/directory.py
+++ b/morituri/common/directory.py
@@ -44,7 +44,8 @@ class Directory(log.Loggable):
from xdg import BaseDirectory
path = BaseDirectory.save_cache_path('morituri')
self.info('Using XDG, cache directory is %s' % path)
- except ImportError:
+ except (ImportError, AttributeError):
+ # save_cache_path was added in pyxdg 0.25
path = os.path.join(os.path.expanduser('~'), '.morituri', 'cache')
if not os.path.exists(path):
os.makedirs(path)
@@ -65,7 +66,8 @@ class Directory(log.Loggable):
path = BaseDirectory.save_cache_path('morituri')
self.info('For XDG, read cache directory is %s' % path)
paths.append(path)
- except ImportError:
+ except (ImportError, AttributeError):
+ # save_cache_path was added in pyxdg 0.21
pass
path = os.path.join(os.path.expanduser('~'), '.morituri', 'cache')
--
morituri packaging
More information about the pkg-multimedia-commits
mailing list