~ubuntu-branches/debian/jessie/cherrypy3/jessie

« back to all changes in this revision

Viewing changes to cherrypy/lib/cptools.py

  • Committer: Bazaar Package Importer
  • Author(s): Gustavo Noronha Silva
  • Date: 2009-08-15 14:52:43 UTC
  • mfrom: (6.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090815145243-ydtmn7e0vejt4r3l
* New upstream release (Closes: #528473)
* debian/rules:
- use the quilt make include file instead of using custom code; should
  make the package convertable to the new quilt source format
  (Closes: #538677)
* debian/control:
- updated Standards-Version with no changes
* debian/python-cherrypy3.links:
- fix link to point to the new place where python-support installs files

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
"""Functions for builtin CherryPy tools."""
2
2
 
3
3
import logging
4
 
import md5
 
4
 
 
5
try:
 
6
    # Python 2.5+
 
7
    from hashlib import md5
 
8
except ImportError:
 
9
    from md5 import new as md5
 
10
 
5
11
import re
6
12
 
7
13
import cherrypy
40
46
    if (not etag) and autotags:
41
47
        if status == 200:
42
48
            etag = response.collapse_body()
43
 
            etag = '"%s"' % md5.new(etag).hexdigest()
 
49
            etag = '"%s"' % md5(etag).hexdigest()
44
50
            response.headers['ETag'] = etag
45
51
    
46
52
    response.ETag = etag