Skip to content

Commit

Permalink
Expose GzipEncoder through new encoders module
Browse files Browse the repository at this point in the history
  • Loading branch information
alekstorm committed Nov 17, 2011
1 parent b98d573 commit 17c0415
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions vortex/__init__.py
Expand Up @@ -192,7 +192,7 @@ def __str__(self):
return b'\r\n'.join(lines) + b'\r\n\r\n'


class GzipEncoder(object):
class _GzipEncoder(object):
def __init__(self, request, response):
response.headers['Vary'] = response.headers.get('Vary', '') + ',Accept-Encoding'
self._accepted = 'gzip' in request.headers.get('Accept-Encoding', '').replace(' ','').split(',')
Expand All @@ -218,7 +218,7 @@ def finish(self, data):


class HTTPStream(object):
def __init__(self, request, response, encoders=[GzipEncoder]):
def __init__(self, request, response, encoders=[_GzipEncoder]):
self._request = request
self._response = response
self._buffer = []
Expand Down
4 changes: 4 additions & 0 deletions vortex/encoders.py
@@ -0,0 +1,4 @@
# All encoders should technically be defined here, but vortex.HTTPStream uses
# GzipEncoder by default, which would create a circular dependency. Therefore,
# it's defined in the root module, but exposed publicly here.
from vortex import _GzipEncoder as GzipEncoder
5 changes: 0 additions & 5 deletions vortex/streams.py

This file was deleted.

0 comments on commit 17c0415

Please sign in to comment.