# HG changeset patch # User Jeff Hammel # Date 1316367606 25200 # Node ID 0c344ed749ac421443ce72ac8f696d4719b3f909 # Parent 44cbfaefa85c41e015c32de866ee5984d9a3088d fix typos diff -r 44cbfaefa85c -r 0c344ed749ac fetch/main.py --- a/fetch/main.py Sun Sep 18 10:35:30 2011 -0700 +++ b/fetch/main.py Sun Sep 18 10:40:06 2011 -0700 @@ -74,6 +74,14 @@ fetcher(destination) def fetch(self, *items): + + if self.strict: + # ensure all the required fetchers are available + types = set([i['type'] for i in items]) + assert not [i for i in types + if [True for fetcher in fetchers if fetcher.match(i)]] + + # fetch the items for item in items: self(item['url']) @@ -87,7 +95,7 @@ """ % format_string # sanity check - assert not [i for i in manifest if not.os.path.exists(i)] + assert not [i for i in manifests if not os.path.exists(i)] retval = [] @@ -112,7 +120,7 @@ retval.append(dict(url=url, dest=dest, type=_type, options=options, manifest=manifest)) return retval -def main(args=sys.argv[:]): +def main(args=sys.argv[1:]): # parse command line options usage = '%prog [options] manifest [manifest] [...]' @@ -143,12 +151,6 @@ items = read_manifests(*args) fetch = Fetch(fetchers, strict=options.strict) - # ensure the all the required fetchers are available - # TODO: to Fetch class - types = set([i['type'] for i in items]) - assert not [i for i in types - if [True for fetcher in fetchers if fetcher.match(i)]] - # download the files fetch.fetch(*items)