create folder for cache

This commit is contained in:
j 2009-10-23 20:33:34 +02:00
parent 3aad9feb47
commit 99bc5eab46
2 changed files with 4 additions and 2 deletions

View file

@ -98,7 +98,10 @@ def _getCacheBase():
return os.environ.get('oxCACHE', os.path.expanduser('~/.ox/cache')) return os.environ.get('oxCACHE', os.path.expanduser('~/.ox/cache'))
def _getCacheDB(): def _getCacheDB():
return os.path.join(_getCacheBase(), "cache.sqlite") path = _getCacheBase()
if not os.path.exists(os.path.dirname(path)):
os.makedirs(os.path.exists(os.path.dirname(path)))
return os.path.join(path, "cache.sqlite")
def _connectDb(): def _connectDb():
conn = sqlite3.connect(_getCacheDB(), timeout=10) conn = sqlite3.connect(_getCacheDB(), timeout=10)

View file

@ -20,7 +20,6 @@ setup(
download_url="http://code.0xdb.org/python-oxlib/download", download_url="http://code.0xdb.org/python-oxlib/download",
license="GPLv3", license="GPLv3",
packages=['oxlib'], packages=['oxlib'],
zip_safe=False,
keywords = [ keywords = [
], ],
classifiers = [ classifiers = [