def __init__(self, url, wait=<NUM_LIT>, asynchronous=False, cache=None, type="<STR_LIT>", throttle=<NUM_LIT:0>):
self.url = url<EOL>self.data = None<EOL>self.redirect = None<EOL>self.error = None<EOL>if cache != None:<EOL><INDENT>self.cached = True<EOL>self._cache = Cache(cache, type)<EOL><DEDENT>else:<EOL><INDENT>self.cached = False<EOL>self._cache = None<EOL><DEDENT>self._domain = URLParser(self.url).domain<EOL>self._throttle = throttle<EOL>global urlaccumulator_throttle<EOL>if not self._domain in urlaccumulator_throttle:<EOL><INDENT>urlaccumulator_throttle[self._domain] = time.time() - self._throttle<EOL><DEDENT>self._start = time.time()<EOL>self._wait = wait<EOL>self._busy = True<EOL>self._loaded = False<EOL>_thread.start_new_thread(self._retrieve, (self.url,))<EOL>if not asynchronous:<EOL><INDENT>while not self._done():<EOL><INDENT>time.sleep(<NUM_LIT:0.1>)<EOL><DEDENT><DEDENT>
Creates a threaded connection to a url and reads data.

        URLAccumulator can run asynchronously which is useful for animations.
        The done property is set to True when downloading is complete.
        The error attribute contains a URLError exception when no data is found.

        URLAccumulator data can be cached.
        Downloads that resulted in an error will write an empty file to the cache,
        the data property will be an empty string but no error is logged
        when the data is read from the cache in later calls.

        URLAccumulator can be throttled.
        This ensures only a certain amount of requests to a domain
        will happen in a given period of time.

        URLAccumulator data is loaded.
        It has a load() method that is called once when done.