assert len(puid)==36 data= urllib.urlencode([ ("client" , "albumrenamer-1"), ("puid" , "%s %s" % (trackid,puid)), ],True) try: f = opener.open(url,data) f.read() except urllib2.HTTPError, e: print e print e.read() raise # Flush these entries out of the cache, so they'll be found next time try: lookups.remove_from_cache("delayed_get_tracks_by_puid",puid) lookups.remote_from_cache("delayed_get_track_by_id",trackid) except Exception, e: print e @lookups.delayed() def _submit_puids(puid2track): build_opener() data= urllib.urlencode([ ("client" , "albumrenamer-1"), ]+[ ("puid" , "%s %s" % (clean_uuid(trackid), clean_uuid(puid))) for (puid,trackid) in puid2track.items() ],True)