diff options
| author | Nick Mathewson <nickm@torproject.org> | 2006-11-26 06:20:01 +0000 |
|---|---|---|
| committer | Nick Mathewson <nickm@torproject.org> | 2006-11-26 06:20:01 +0000 |
| commit | adc4079a71c331fcb5c0d506a9d152307b5daeb2 (patch) | |
| tree | 6e69e7e550527b123bdabdb92fa72bb407b5b633 /updateCache.py | |
| parent | facf12ce463ba1c05b9147f2e79de550864af4a8 (diff) | |
| download | anonbib-adc4079a71c331fcb5c0d506a9d152307b5daeb2.tar.gz | |
r9809@Kushana: nickm | 2006-11-26 01:14:14 -0500
Write command-line code in a check for __name__=="__main__" so I can run anonbib stuff through pychecker.
svn:r186
Diffstat (limited to 'updateCache.py')
| -rwxr-xr-x | updateCache.py | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/updateCache.py b/updateCache.py index 2dd7998..8e1af06 100755 --- a/updateCache.py +++ b/updateCache.py @@ -150,12 +150,14 @@ def downloadAll(bibtex, missingOnly=0): return errors -if len(sys.argv) == 2: - print "Loading from %s"%sys.argv[1] -else: - print >>sys.stderr, "Expected a single configuration file as an argument" - sys.exit(1) -config.load(sys.argv[1]) +if __name__ == '__main__': -bib = BibTeX.parseFile(config.MASTER_BIB) -downloadAll(bib,missingOnly=1) + if len(sys.argv) == 2: + print "Loading from %s"%sys.argv[1] + else: + print >>sys.stderr, "Expected a single configuration file as an argument" + sys.exit(1) + config.load(sys.argv[1]) + + bib = BibTeX.parseFile(config.MASTER_BIB) + downloadAll(bib,missingOnly=1) |
