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

Changeset 1138

Show
Ignore:
Timestamp:
06/12/06 01:09:46
Author:
fumanchu
Message:

More Python 2.3 safety and coments.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/test/test_core.py

    r1134 r1138  
    134134            return str(cherrypy.HTTPRedirect("/")) 
    135135     
    136      
    137136    def login_redir(): 
    138137        if not getattr(cherrypy.request, "login", None): 
     
    162161                raise cherrypy.InternalRedirect('/image/getImagesByUser') 
    163162         
     163        # We support Python 2.3, but the @-deco syntax would look like this: 
     164        # @tools.login_redir.wrap() 
    164165        def secure(self): 
    165166            return "Welcome!" 
  • trunk/cherrypy/test/test_tools.py

    r1134 r1138  
    7676         
    7777        # METHOD FOUR: decorator using Tool.enable 
    78         @tools.base_url.enable() 
     78        # We support Python 2.3, but the @-deco syntax would look like this: 
     79        # @tools.base_url.enable() 
    7980        def base(self): 
    8081            return cherrypy.request.base 
     82        base = tools.base_url.enable()(base) 
    8183        base.exposed = True 
    8284     
     
    118120         
    119121        # METHOD TWO: decorator using Tool.wrap 
     122        # We support Python 2.3, but the @-deco syntax would look like this: 
     123        # @tools.check_access.wrap() 
    120124        def restricted(self): 
    121125            return "Welcome!" 

Hosted by WebFaction

Log in as guest/cpguest to create tickets