"""Fetch Transitland Feed Registry feeds."""
import argparse

import registry

def run():
  parser = argparse.ArgumentParser(description='Fetch Transitland Feeds')
  parser.add_argument('feedids', nargs='*', help='Feed IDs')
  parser.add_argument('--registry', help='Feed Registry Path')
  parser.add_argument('--all', help='Update all feeds', action='store_true')
  parser.add_argument('--verbose', help='Verbosity', type=int, default=1)
  args = parser.parse_args()

  # Transitland Feed Registry
  r = registry.FeedRegistry(path=args.registry)
  feedids = args.feedids
  if args.all:
    feedids = r.feeds()
  if len(feedids) == 0:
    raise Exception("No feeds specified! Try --all")
  for feedid in feedids:
    feed = r.feed(feedid)
    feed.download(debug=args.verbose)
    
if __name__ == "__main__":
  run()
@@ -70,16 +70,28 @@
 registry
+%0Aimport util
 %0A%0Adef ru
@@ -753,45 +753,266 @@
    f
-eed.download(debug=args.verbose)%0A    
+ilename = '%25s.zip'%25feed.onestop()%0A    print %22Downloading: %25s -%3E %25s%22%25(feed.url(), filename)%0A    feed.download(filename, verify=False)%0A    if not feed.verify_sha1(filename):%0A      print %22%22%22Warning: Incorrect SHA1 checksum. Feed Registry may be out of date.%22%22%22%0A
 %0Aif 

Verify checksum after downloading