changeset 2:0c344ed749ac

fix typos
author Jeff Hammel <jhammel@mozilla.com>
date Sun, 18 Sep 2011 10:40:06 -0700
parents 44cbfaefa85c
children 11e11e5c0c48
files fetch/main.py
diffstat 1 files changed, 10 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- 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)