@@ -0,0 +1,1457 @@
+#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%0Aimport glob%0Aimport imp%0Aimport re%0Aimport requests%0Aimport sys%0Aimport threading%0Afrom Queue import Queue%0A%0Afrom plugin_handler import load_venue_plugins%0A%0AMAX_THREADS = 6%0A%0A%0A# XXX Rough implementation of parallel venue fetcher%0Aclass Fetcher(threading.Thread):%0A    def __init__(self, q):%0A        threading.Thread.__init__(self)%0A%0A        self.fetchqueue = q%0A%0A    def run(self):%0A        %22%22%22docstring for run%22%22%22%0A        while True:%0A            venue = self.fetchqueue.get()%0A            venue_data = start_fetching(venue)%0A            print %22%5B-%5D Fetching and parsing '%25s'%22 %25 (venue.name)%0A            self.fetchqueue.task_done()%0A            # TODO Implement callback to completed venues%0A            #print %22%5B+%5D Fetching '%25s' completed%22 %25 (venue.name)%0A%0A%0Adef start_fetching(venue):%0A    retries = 3%0A    r = requests.get(venue.url)%0A%0A    if r.status_code is not 200:%0A        for retry in range(0, retries):%0A            print %22Couldn't connect %25s, retrying %25d/%25d...%22 %25 (venue.url, retry + 1, retries)%0A            r = requests.get(venue.url)%0A    try:%0A        venue.parseArtists(r.text)%0A    except Exception, e:%0A        raise e%0A%0A%0Adef main():%0A    fetchqueue = Queue()%0A    venues = load_venue_plugins()%0A    %0A    for v in range(MAX_THREADS):%0A        t = Fetcher(fetchqueue)%0A        t.setDaemon(True)%0A        t.start()%0A    for venue in venues:%0A        fetchqueue.put(venue)%0A    fetchqueue.join()%0A%0Aif __name__ == '__main__':%0A    main()%0A%0A

Bring bandeventnotifier.py into the tree.