aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-01-30 20:03:34 +0000
committerNick Mathewson <nickm@torproject.org>2007-01-30 20:03:34 +0000
commit2341dcce301592eedd28972bf61a2eeea6740ef9 (patch)
treebe82965993bf4b600132c3f94a38ab72810f77bf
parent9939c56195f2d132af48f162b34863e38fb69fe8 (diff)
downloadanonbib-2341dcce301592eedd28972bf61a2eeea6740ef9.tar.gz
r11502@catbus: nickm | 2007-01-25 12:46:36 -0500
Create cache directories when they are missing. svn:r195
-rwxr-xr-xupdateCache.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/updateCache.py b/updateCache.py
index 37ac01e..ad62419 100755
--- a/updateCache.py
+++ b/updateCache.py
@@ -40,6 +40,10 @@ def downloadFile(key, ftype, section, url,timeout=None):
if timeout is None:
timeout = config.DOWNLOAD_CONNECT_TIMEOUT
fname = getCacheFname(key, ftype, section)
+ parent = os.path.split(fname)[0]
+ if not os.path.exists(parent):
+ os.makedirs(parent)
+
fnameTmp = fname+".tmp"
fnameURL = fname+".url"
tryUnlink(fnameTmp)
@@ -150,7 +154,6 @@ def downloadAll(bibtex, missingOnly=0):
return errors
if __name__ == '__main__':
-
if len(sys.argv) == 2:
print "Loading from %s"%sys.argv[1]
else: