diff options
| author | Nick Mathewson <nickm@torproject.org> | 2007-01-30 20:03:34 +0000 |
|---|---|---|
| committer | Nick Mathewson <nickm@torproject.org> | 2007-01-30 20:03:34 +0000 |
| commit | 2341dcce301592eedd28972bf61a2eeea6740ef9 (patch) | |
| tree | be82965993bf4b600132c3f94a38ab72810f77bf | |
| parent | 9939c56195f2d132af48f162b34863e38fb69fe8 (diff) | |
| download | anonbib-2341dcce301592eedd28972bf61a2eeea6740ef9.tar.gz | |
r11502@catbus: nickm | 2007-01-25 12:46:36 -0500
Create cache directories when they are missing.
svn:r195
| -rwxr-xr-x | updateCache.py | 5 |
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: |
