Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install zif.gzipper

How to install zif.gzipper

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install zif.gzipper
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.2 Available View build log
Windows (64-bit)
0.2 Available View build log
Mac OS X (10.5+)
0.2 Available View build log
Linux (32-bit)
0.2 Available View build log
Linux (64-bit)
0.2 Available View build log
 
License
BSD
Dependencies
Imports
Lastest release
version 0.2 on Jan 5th, 2011

See 'src/zif/gzipper/README.txt' for more information.

Releases

0.2 (2007/04/13)

Small improvements to documentation files.

0.1 (2007/04/12)

Initial release. Detailed Documentation ******************

zif.gzipper

This is a wsgi middleware application intended for use with paste.deploy, zope.paste, and zope3.

It serves as a wsgi filter to gzip output from a zope3 application.

Dependencies

for zope3, zif.gzipper requires Sidnei da Silva's zope.paste

zope.paste is available at http://svn.zope.org/zope.paste/trunk/

System Message: WARNING/2 (<string>, line 45)

Literal block expected; none found.

cd [path.to.zope3.src.directory]/zope svn co http://svn.zope.org/zope.paste/trunk/ paste

zope.paste is also available at the python cheese shop.

Instructions for zope.paste are at http://awkly.org/2006/01/25/zopepaste-wsgi-applications-in-zope-3-using-pastedeploy/

zope.paste requires paste.deploy. paste.deploy may be obtained from the cheese shop. Presuming you have setuptools installed,

System Message: WARNING/2 (<string>, line 60)

Literal block expected; none found.

sudo easy_install.py PasteDeploy

This (zif.gzipper) package can be unzipped and installed anywhere on the Python path.

Setup

Follow Sidnei's instructions for setting up zope.paste. It involves putting the usual zope.paste-configure.zcml file in [zope3 instance]/etc/site-packages. There is also a parameter to change in [zope3 instance]/etc/zope.conf. The new twist is a paste.ini file in [zope3 instance]/etc

My paste.ini file looks like:

[pipeline:Paste.Main]

System Message: ERROR/3 (<string>, line 78)

Inconsistent literal block quoting.

pipeline = gzipper jsmin main

[app:main] paste.app_factory = zope.paste.application:zope_publisher_app_factory

[filter:gzipper] paste.filter_factory=zif.gzipper.gzipper:filter_factory compress_level=6 exclude=localimages nocompress=jp gz zip png tempfile=1048576

[filter:jsmin] paste.filter_factory=zif.jsmin.jsmin:filter_factory compress_level=safe

Configuration

gzipper should be the first filter in the pipeline. Other filters will have a hard time reading compressed data output from this filter.

The paste.ini file above shows examples of the configuration options for gzipper.

  • compress_level is the level of compression for the gzip function. 6 is the

System Message: WARNING/2 (<string>, line 104)

Bullet list ends without a blank line; unexpected unindent.

default. 9 is max. 3 is often good enough. Higher numbers use more processor, but compress smaller.

  • exclude is a sequence of strings that appear in the a filename or path

System Message: WARNING/2 (<string>, line 108)

Bullet list ends without a blank line; unexpected unindent.

you wish to exclude from gzipping. If any of these strings appears in the path or filename, gzipper will not gzip the file.

  • nocompress is a sequence of strings that appear in content-types you wish to

System Message: WARNING/2 (<string>, line 112)

Bullet list ends without a blank line; unexpected unindent.

exclude from gzipping. If the string appears anywhere in the content-type, items with that content-type will not be gzipped. "jp" will exclude "image/jpg" and "image/jpeg". "application" will exclude any content-type with the word "application" in it.

  • tempfile is the file size above which gzipper will send the gzipped data to

System Message: WARNING/2 (<string>, line 119)

Bullet list ends without a blank line; unexpected unindent.

a tempfile on disk. This may help memory usage. It may not. tempfile=0 means do not use temporary file. Default is 1 megabyte (1048576).

Download

Subscribe to package updates

Last updated Jan 5th, 2011

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.