Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(8)  |  Call(8)  |  Derive(0)  |  Import(0)

src/d/j/django-pipes-0.2/django_pipes/main.py   django-pipes(Download)
                _log("Found in cache.")
                stop = time()
                debug_stats.record_query(url_string, found_in_cache=True, time=stop-start)
            else: 
                # Not found in cache
                    except urllib2.HTTPError, e:
                        stop = time()
                        debug_stats.record_query(url_string, failed=True, retries=attempts-1, time=stop-start)
                        raise ResourceNotAvailableException(code=e.code, resp=e.read())
                    except urllib2.URLError, e:
                        else: 
                            stop = time()
                            debug_stats.record_query(url_string, failed=True, retries=attempts-1, time=stop-start)
                            raise ResourceNotAvailableException(reason=e.reason)
 
                resp = respObj.read()
                if should_cache:
                    cache.set(url_string, resp, cache_expiry)
                stop = time()
                debug_stats.record_query(url_string, retries=attempts-1, time=stop-start)

src/d/j/django-pipes-HEAD/django_pipes/main.py   django-pipes(Download)
                _log("Found in cache.")
                stop = time()
                debug_stats.record_query(url_string, found_in_cache=True, time=stop-start)
            else: 
                # Not found in cache
                    except urllib2.HTTPError, e:
                        stop = time()
                        debug_stats.record_query(url_string, failed=True, retries=attempts-1, time=stop-start)
                        raise ResourceNotAvailableException(code=e.code, resp=e.read())
                    except urllib2.URLError, e:
                        if attempts <= retries:
                            continue
                        else: 
                            stop = time()
                            debug_stats.record_query(url_string, failed=True, retries=attempts-1, time=stop-start)
                    cache.set(url_string, resp, cache_expiry)
                stop = time()
                debug_stats.record_query(url_string, retries=attempts-1, time=stop-start)
 
            resp_obj = simplejson.loads(resp)