Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 1053

Show
Ignore:
Timestamp:
04/22/06 12:18:36
Author:
fumanchu
Message:

Fixed decode, encode, gzip tools and tests.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/lib/encodings.py

    r1049 r1053  
     1import struct 
     2import time 
     3import zlib 
     4 
    15import cherrypy 
    26 
  • trunk/cherrypy/test/test_decodingencoding_filter.py

    r1017 r1053  
    2424            'server.log_to_screen': False, 
    2525            'server.environment': 'production', 
    26             'encoding_filter.on': True, 
    27             'decoding_filter.on': True 
     26            'tools.encode.on': True, 
     27            'tools.decode.on': True, 
    2828    }) 
    2929 
  • trunk/cherrypy/test/test_gzip_filter.py

    r1017 r1053  
    3030                   'server.environment': 'production', 
    3131                   'server.show_tracebacks': True, 
    32                    'gzip_filter.on': True, 
     32                   'tools.gzip.on': True, 
    3333                   }, 
    3434        '/noshow_stream': {'stream_response': True}, 
  • trunk/cherrypy/tools.py

    r1052 r1053  
    44may only offer one if they choose): 
    55     
    6     Library calls: all tools expose various callables that can be used 
    7         wherever needed. The arguments are straightforward and should b
    8         detailed within the docstring. 
     6    Library calls: all tools are callables that can be used wherever needed. 
     7        The arguments are straightforward and should be detailed within th
     8        docstring. 
    99     
    1010    Function decorators: if the tool exposes a "wrap" callable, that 
     
    2626 
    2727import cherrypy 
    28 from cherrypy.lib import cptools, static 
     28from cherrypy.lib import cptools, encodings, static 
    2929 
    3030# These modules are themselves Tools 
     
    9797response_headers = Tool('before_finalize', cptools.response_headers) 
    9898virtual_host = Tool('before_request_body', cptools.virtual_host) 
     99 
     100decode = Tool('before_main', encodings.decode) 
     101encode = Tool('before_finalize', encodings.encode) 
     102gzip = Tool('before_finalize', encodings.gzip) 
     103 
    99104staticdir = MainTool(static.get_dir) 
    100105staticfile = MainTool(static.get_file) 

Hosted by WebFaction

Log in as guest/cpguest to create tickets