summaryrefslogtreecommitdiffstats
path: root/WebKitTools/Scripts/webkitpy/thirdparty/autoinstalled/mechanize/_seek.py
blob: 4086d527927428a2be9f8e324cb3a9751ebbed2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from urllib2 import BaseHandler
from _util import deprecation
from _response import response_seek_wrapper


class SeekableProcessor(BaseHandler):
    """Deprecated: Make responses seekable."""

    def __init__(self):
        deprecation(
            "See http://wwwsearch.sourceforge.net/mechanize/doc.html#seekable")

    def any_response(self, request, response):
        if not hasattr(response, "seek"):
            return response_seek_wrapper(response)
        return response