commit d6f4cde1173871525ef7a00dd39ddc1be5875f32
parent 9bef0bfbe6a6edd233b80760b77887cbd5cf80b1
Author: Nick Mathewson <nickm@torproject.org>
Date: Tue, 30 Jan 2007 20:03:34 +0000
r11502@catbus: nickm | 2007-01-25 12:46:36 -0500
Create cache directories when they are missing.
svn:r195
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git 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: