From 2341dcce301592eedd28972bf61a2eeea6740ef9 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 30 Jan 2007 20:03:34 +0000 Subject: r11502@catbus: nickm | 2007-01-25 12:46:36 -0500 Create cache directories when they are missing. svn:r195 --- updateCache.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'updateCache.py') 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: -- cgit v1.2.3-70-g09d2