/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/transport/http/__init__.py

  • Committer: Jelmer Vernooij
  • Date: 2019-05-19 22:33:19 UTC
  • mto: This revision was merged to the branch mainline in revision 7302.
  • Revision ID: jelmer@jelmer.uk-20190519223319-hkrirkte77xguwsm
More work to make API more like urllib3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1936
1936
            raise NotImplementedError(
1937
1937
                'the fields argument is not yet supported')
1938
1938
        body = urlopen_kw.pop('body', None)
1939
 
        self.follow_redirections = (urlopen_kw.pop('retries', 0) > 0)
1940
 
        if urlopen_kw:
1941
 
            raise NotImplementedError(
1942
 
                'unknown arguments: %r' % urlopen_kw.keys())
1943
1939
        if headers is None:
1944
1940
            headers = {}
1945
1941
        request = Request(method, url, body, headers)
 
1942
        request.follow_redirections = (urlopen_kw.pop('retries', 0) > 0)
 
1943
        if urlopen_kw:
 
1944
            raise NotImplementedError(
 
1945
                'unknown arguments: %r' % urlopen_kw.keys())
1946
1946
        connection = self._get_connection()
1947
1947
        if connection is not None:
1948
1948
            # Give back shared info
1990
1990
            def __init__(self, actual):
1991
1991
                self._actual = actual
1992
1992
 
 
1993
            def getheader(self, header, default=None):
 
1994
                if self._actual.headers is None:
 
1995
                    raise http_client.ResponseNotReady()
 
1996
                return self._actual.headers.getheader(name, default)
 
1997
 
 
1998
            def getheaders(self):
 
1999
                if self._actual.headers is None:
 
2000
                    raise http_client.ResponseNotReady()
 
2001
                return list(self._actual.headers.items())
 
2002
 
1993
2003
            @property
1994
2004
            def status(self):
1995
2005
                return self._actual.code