summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorianb <devnull@localhost>2006-10-20 18:36:46 +0000
committerianb <devnull@localhost>2006-10-20 18:36:46 +0000
commit315957c3dd7a71957a15b4fa2048601247ecae83 (patch)
tree9b119369e9b82c9d4889047077a001d19a978b18
parent9366c845452889ccd5a09f85c6a3a0c51695a44d (diff)
downloadpaste-315957c3dd7a71957a15b4fa2048601247ecae83.tar.gz
Moved and fixed gzip middleware entry point; typo in docs
-rw-r--r--docs/DeveloperGuidelines.txt2
-rw-r--r--paste/gzipper.py13
-rw-r--r--setup.py2
3 files changed, 15 insertions, 2 deletions
diff --git a/docs/DeveloperGuidelines.txt b/docs/DeveloperGuidelines.txt
index 7b88966..69f39ee 100644
--- a/docs/DeveloperGuidelines.txt
+++ b/docs/DeveloperGuidelines.txt
@@ -68,7 +68,7 @@ is going to bite your head off for committing something.
def backward_compat_function(*args, **kw):
import warnings
# Deprecated on 2005 Mar 5
- warnings.warn('Moved to foo.function', DeprecationWarnings, 2)
+ warnings.warn('Moved to foo.function', DeprecationWarning, 2)
return foo.function(*args, **kw)
* If something is really experimental, put it in your home directory,
diff --git a/paste/gzipper.py b/paste/gzipper.py
index 2b01c5c..5ec2efe 100644
--- a/paste/gzipper.py
+++ b/paste/gzipper.py
@@ -84,6 +84,19 @@ class GzipResponse(object):
app_iter.close()
def filter_factory(application, **conf):
+ import warnings
+ warnings.warn(
+ 'This function is deprecated; use make_gzip_middleware instead',
+ DeprecationWarning, 2)
def filter(application):
return middleware(application)
return filter
+
+def make_gzip_middleware(app, global_conf, compress_level=6):
+ """
+ Wrap the middleware, so that it applies gzipping to a response
+ when it is supported by the browser and the content is of
+ type ``text/*`` or ``application/*``
+ """
+ compress_level = int(compress_level)
+ return middleware(app, compress_level=compress_level)
diff --git a/setup.py b/setup.py
index d50fffb..e282129 100644
--- a/setup.py
+++ b/setup.py
@@ -156,7 +156,7 @@ For the latest changes see the `news file
error_catcher = paste.exceptions.errormiddleware:make_error_middleware
cgitb = paste.cgitb_catcher:make_cgitb_middleware
flup_session = paste.flup_session:make_session_middleware [Flup]
- gzip = paste.gzipper:middleware
+ gzip = paste.gzipper:make_gzip_middleware
httpexceptions = paste.httpexceptions:make_middleware
lint = paste.lint:make_middleware
printdebug = paste.debug.prints:PrintDebugMiddleware