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

Changeset 1739

Show
Ignore:
Timestamp:
10/08/07 17:51:12
Author:
fumanchu
Message:

Doc updates, better memcached detection in test_session, and changed cherrypy.url to be more easily mockable.

Files:

Legend:

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

    r1720 r1739  
    113113            2. __metaclass__ can be specified at the module global level 
    114114               for classic classes. 
     115         
     116        For various formatting reasons, you should write multiline docs 
     117        with a leading newline and not a trailing one: 
     118             
     119            response__doc = """ 
     120            The response object for the current thread. In the main thread, 
     121            and any threads which are not HTTP requests, this is None.""" 
    115122         
    116123        The type of the attribute is intentionally not included, because 
     
    457464         
    458465        if script_name is None: 
    459             script_name = request.app.script_name 
     466            script_name = request.script_name 
    460467        if base is None: 
    461468            base = request.base 
  • trunk/cherrypy/restsrv/plugins.py

    r1690 r1739  
    229229     
    230230    # See http://www.erlenstar.demon.co.uk/unix/faq_2.html#SEC16 
     231    # (or http://www.faqs.org/faqs/unix-faq/programmer/faq/ section 1.7) 
    231232    # and http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66012 
    232233     
  • trunk/cherrypy/test/test_session.py

    r1736 r1739  
    207207try: 
    208208    import memcache 
    209 except ImportError: 
    210     pass 
     209    import socket 
     210     
     211    host, port = '127.0.0.1', 11211 
     212    for res in socket.getaddrinfo(host, port, socket.AF_UNSPEC, 
     213                                  socket.SOCK_STREAM): 
     214        af, socktype, proto, canonname, sa = res 
     215        s = None 
     216        try: 
     217            s = socket.socket(af, socktype, proto) 
     218            # See http://groups.google.com/group/cherrypy-users/ 
     219            #        browse_frm/thread/bbfe5eb39c904fe0 
     220            s.settimeout(1.0) 
     221            s.connect((host, port)) 
     222            s.close() 
     223        except socket.error: 
     224            if s: 
     225                s.close() 
     226            raise 
     227        break 
     228except (ImportError, socket.error): 
     229    class MemcachedSessionTest(helper.CPWebCase): 
     230         
     231        def test(self): 
     232            print "skipped", 
    211233else: 
    212234    class MemcachedSessionTest(helper.CPWebCase): 

Hosted by WebFaction

Log in as guest/cpguest to create tickets