From adc4079a71c331fcb5c0d506a9d152307b5daeb2 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Sun, 26 Nov 2006 06:20:01 +0000 Subject: 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 --- updateCache.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'updateCache.py') 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]) - -bib = BibTeX.parseFile(config.MASTER_BIB) -downloadAll(bib,missingOnly=1) +if __name__ == '__main__': + + 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) -- cgit v1.2.3-70-g09d2