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

Changeset 857

Show
Ignore:
Timestamp:
12/05/05 09:22:16
Author:
rdelon
Message:

Updated book to reflect [856]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/docs/book/xml/apireference.xml

    r856 r857  
    389389          use this to automatically select between the CherryHTTPServer  
    390390          and the PooledThreadServer based on the value of  
    391           config.get("server.threadPool") and  
    392           config.get(&quot;server.socketFile&quot;).</para> 
     391          config.get(&quot;server.thread_pool&quot;) and  
     392          config.get(&quot;server.socket_file&quot;).</para> 
    393393 
    394394        </listitem> 
     
    548548    <section> 
    549549 
    550       <title>cherrypy.server.onStartServerList</title> 
     550      <title>cherrypy.server.on_start_server_list</title> 
    551551 
    552552      <para>A list of functions that will be called when the server  
     
    557557    <section> 
    558558 
    559       <title>cherrypy.server.onStopServerList</title> 
     559      <title>cherrypy.server.on_stop_server_list</title> 
    560560 
    561561      <para>A list of functions that will be called when the server  
     
    566566    <section> 
    567567 
    568       <title>cherrypy.server.onStartThreadList</title> 
     568      <title>cherrypy.server.on_start_thread_list</title> 
    569569 
    570570      <para>A list of functions that will be called when each request  
     
    572572      started or controlled by CherryPy; for example, when using  
    573573      CherryPy with mod_python, Apache will start and stop the request  
    574       threads. Nevertheless, CherryPy will run the onStartThreadList  
     574      threads. Nevertheless, CherryPy will run the on_start_thread_list  
    575575      functions upon the first request using each distinct  
    576576      thread.</para> 
     
    580580    <section> 
    581581 
    582       <title>cherrypy.server.onStopThreadList</title> 
     582      <title>cherrypy.server.on_stop_thread_list</title> 
    583583 
    584584      <para>A list of functions that will be called when each request  
     
    767767      <section> 
    768768 
    769         <title>HeaderMap</title> 
     769        <title>headers</title> 
    770770 
    771771        <para>A subclass of Python&apos;s builtin <code>dict</code>  
     
    926926    <section> 
    927927 
    928       <title>_cpOnError</title> 
    929  
    930       <para>_cpOnError is a function for handling unanticipated  
     928      <title>_cp_on_error</title> 
     929 
     930      <para>_cp_on_error is a function for handling unanticipated  
    931931      exceptions, whether raised by CherryPy itself, or in user  
    932932      applications. The default simply responds as if HTTPError(500)  
     
    937937    <section> 
    938938 
    939       <title>_cpOnHTTPError</title> 
    940  
    941       <para>_cpOnHTTPError handles HTTPError responses, setting  
     939      <title>_cp_on_http_error</title> 
     940 
     941      <para>_cp_on_http_error handles HTTPError responses, setting  
    942942      cherrypy.response.status, headers, and body.</para> 
    943943 
     
    946946    <section> 
    947947 
    948       <title>_cpFilterList</title> 
     948      <title>_cp_filters</title> 
    949949 
    950950      <para>User defined filters are enabled using the class attribute  
    951       _cpFilterList. Any filter instances placed in _cpFilterList will  
     951      _cp_filters. Any filter instances placed in _cp_filters will  
    952952      be applied to all methods of the class.</para> 
    953953 
     
    956956    <section> 
    957957 
    958       <title>_cpLogAccess</title> 
     958      <title>_cp_log_access</title> 
    959959 
    960960      <para>Function to log HTTP requests into the access.log  
     
    982982    <section> 
    983983 
    984       <title>onStartResource</title> 
     984      <title>on_start_resource</title> 
    985985            <para>This hook is being called righ at the beginning of the request process. The only work CherryPy has done when this hook is called is to parse the first line of the HTTP request. This is needed so that filters have access to the object path translated from the path specified in the HTTP request.</para> 
    986986            <para>This hook is always called.</para> 
     
    989989    <section> 
    990990 
    991       <title>beforeRequestBody</title> 
     991      <title>before_request_body</title> 
    992992            <para>This hook is being called right after CherryPy has parse the HTTP request headers but before it tries to parse the request body.  If a filter which implements that hook sets cherrypy.request.processRequestBody to False, CherryPy will not parse the request body at all. 
    993993            This can be handy when you know your user agent returns the data in a form that the default CherryPy request body parsing function cannot understand. </para> 
     
    10011001    <section> 
    10021002 
    1003       <title>beforeMain</title> 
     1003      <title>before_main</title> 
    10041004        <para>This hook is called right before your page handler (exposed callable) is being called by CherryPy.  
    10051005                It can be handy if considering HTTP request headers or body you may want not to call the page handler at all, then you would have to set cherrypy.request.executeMain to False.</para> 
     
    10091009    <section> 
    10101010 
    1011       <title>beforeFinalize</title> 
    1012         <para>This hook is called right after the page handler has been processed (depending on the beforeMain hook behavior) and before CherryPy formats the final respone object. 
     1011      <title>before_finalize</title> 
     1012        <para>This hook is called right after the page handler has been processed (depending on the before_main hook behavior) and before CherryPy formats the final respone object. 
    10131013                It helps you for example to check for what could have been returned by your page handler and change some headers of needed.</para> 
    10141014            <para>This hook is not called if an error occurs during the process before hand.</para> 
     
    10171017    <section> 
    10181018 
    1019       <title>onEndResource</title> 
     1019      <title>on_end_resource</title> 
    10201020            <para>This hook is called at the end of the process so that you can finely tweak your HTTP response if needed (eg adding headers to the cherrypy.response.header_list). Note that cherrypy.response.headers will not be processed any longer at that stage.</para> 
    10211021            <para>This hook is always called.</para> 
     
    10241024    <section> 
    10251025 
    1026       <title>beforeErrorResponse</title> 
    1027             <para>This hook is called when an error has occured during the request processing. It allows you to called code before the _cpOnError handler is being called as well as the response finalizing stage.</para> 
    1028     </section> 
    1029  
    1030     <section> 
    1031  
    1032       <title>afterErrorResponse</title> 
    1033             <para>This hook is called when an error has occured during the request processing. It allows you to call code after the _cpOnError handler is being called as well as the response finalizing stage.</para> 
     1026      <title>before_error_response</title> 
     1027            <para>This hook is called when an error has occured during the request processing. It allows you to called code before the _cp_on_error handler is being called as well as the response finalizing stage.</para> 
     1028    </section> 
     1029 
     1030    <section> 
     1031 
     1032      <title>after_error_response</title> 
     1033            <para>This hook is called when an error has occured during the request processing. It allows you to call code after the _cp_on_error handler is being called as well as the response finalizing stage.</para> 
    10341034    </section> 
    10351035 
  • trunk/docs/book/xml/builtinfilters.xml

    r822 r857  
    1010        <itemizedlist> 
    1111            <listitem> 
    12                 <para>baseUrlFilter.baseUrl</para> 
     12                <para>base_url_filter.base_url</para> 
    1313            </listitem> 
    1414            <listitem> 
    15                 <para>baseUrlFilter.useXForwardedHost</para> 
     15                <para>base_url_filter.use_x_forwarded_host</para> 
    1616            </listitem> 
    1717        </itemizedlist> 
     
    2828        <itemizedlist> 
    2929            <listitem> 
    30                 <para>decodingFilter.encoding</para> 
     30                <para>decoding_filter.encoding</para> 
    3131            </listitem> 
    3232        </itemizedlist> 
     
    3838        <itemizedlist> 
    3939            <listitem> 
    40                 <para>encodingFilter.encoding: Force all text responses to be encoded with this 
     40                <para>encoding_filter.encoding: Force all text responses to be encoded with this 
    4141                encoding.</para> 
    4242            </listitem> 
    4343            <listitem> 
    44                 <para>encodingFilter.defaultEncoding: Default all text responses to this encoding (if 
     44                <para>encoding_filter.default_encoding: Default all text responses to this encoding (if 
    4545                the user-agent does not request otherwise).</para> 
    4646            </listitem> 
     
    6060        <itemizedlist> 
    6161            <listitem> 
    62                 <para>logDebugInfoFilter.mimeTypeList, ['text/html']</para> 
     62                <para>log_debug_info_filter.mime_types, ['text/html']</para> 
    6363            </listitem> 
    6464            <listitem> 
    65                 <para>logDebugInfoFilter.logAsComment, False</para> 
     65                <para>log_debug_info_filter.log_as_comment, False</para> 
    6666            </listitem> 
    6767            <listitem> 
    68                 <para>logDebugInfoFilter.logBuildTime, True</para> 
     68                <para>log_debug_info_filter.log_build_time, True</para> 
    6969            </listitem> 
    7070            <listitem> 
    71                 <para>logDebugInfoFilter.logPageSize, True</para> 
     71                <para>log_debug_info_filter.log_page_size, True</para> 
    7272            </listitem> 
    7373        </itemizedlist> 
     
    7979        <itemizedlist> 
    8080            <listitem> 
    81                 <para>staticFilter.file</para> 
     81                <para>static_filter.file</para> 
    8282            </listitem> 
    8383            <listitem> 
    84                 <para>staticFilter.dir</para> 
     84                <para>static_filter.dir</para> 
    8585            </listitem> 
    8686            <listitem> 
    87                 <para>staticFilter.root</para> 
     87                <para>static_filter.root</para> 
    8888            </listitem> 
    8989        </itemizedlist> 
     
    102102        <itemizedlist> 
    103103            <listitem> 
    104                 <para>tidyFilter.tmpDir</para> 
     104                <para>tidy_filter.tmp_dir</para> 
    105105            </listitem> 
    106106            <listitem> 
    107                 <para>tidyFilter.strictXml, False</para> 
     107                <para>tidy_filter.strict_xml, False</para> 
    108108            </listitem> 
    109109            <listitem> 
    110                 <para>tidyFilter.tidyPath</para> 
     110                <para>tidy_filter.tidy_path</para> 
    111111            </listitem> 
    112112        </itemizedlist> 
     
    119119        <itemizedlist> 
    120120            <listitem> 
    121                 <para>virtualHostFilter.prefix, '/'</para> 
     121                <para>virtual_host_filter.prefix, '/'</para> 
    122122            </listitem> 
    123123        </itemizedlist> 
     
    126126        <title>xmlrpcfilter</title> 
    127127        <para>The xmlrpcfilter converts XMLRPC to the CherryPy2 object system and vice-versa.</para> 
    128         <para>PLEASE NOTE: beforeRequestBody: Unmarshalls the posted data to a methodname and 
     128        <para>PLEASE NOTE: before_request_body: Unmarshalls the posted data to a methodname and 
    129129        parameters. - These are stored in cherrypy.request.rpcMethod and .rpcParams - The method is 
    130130        also stored in cherrypy.request.path, so CP2 will find the right method to call for you, 
    131         based on the root's position. beforeFinalize: Marshalls cherrypy.response.body to xmlrpc. - 
     131        based on the root's position. before_finalize: Marshalls cherrypy.response.body to xmlrpc. - 
    132132        Until resolved: cherrypy.response.body must be a python source string; this string is 
    133133        'eval'ed to return the results. This will be resolved in the future. - Content-Type and 
  • trunk/docs/book/xml/configreference.xml

    r677 r857  
    99    <itemizedlist> 
    1010      <listitem> 
    11         <para><option>[global] server.socketPort</option>: port number where the server is listening (defaults to 8080)</para> 
     11        <para><option>[global] server.socket_port</option>: port number where the server is listening (defaults to 8080)</para> 
    1212      </listitem> 
    1313      <listitem> 
    14         <para><option>[global] server.logFile</option>: path to a file to log CherryPy server activity.  Items logged include startup config info, tracebacks and HTTP requests.  It is disabled by default and everything is logged to the screen.</para> 
     14        <para><option>[global] server.log_file</option>: path to a file to log CherryPy server activity.  Items logged include startup config info, tracebacks and HTTP requests.  It is disabled by default and everything is logged to the screen.</para> 
    1515      </listitem> 
    1616      <listitem> 
    17         <para><option>[global] server.logAccessFile</option>: path to a file where access log data will be stored in Common Log Format.  The default is to write access log data to the screen.  If a file is specified, the access log data is no longer written to the screen.</para> 
     17        <para><option>[global] server.log_access_file</option>: path to a file where access log data will be stored in Common Log Format.  The default is to write access log data to the screen.  If a file is specified, the access log data is no longer written to the screen.</para> 
    1818      </listitem> 
    1919      <listitem> 
    20         <para><option>[global] server.logToScreen</option>: controls whether any log data is written to the screen.  It defaults to on (True).  For performance reasons, it is best to have this option turned off on a production server.</para> 
     20        <para><option>[global] server.log_to_screen</option>: controls whether any log data is written to the screen.  It defaults to on (True).  For performance reasons, it is best to have this option turned off on a production server.</para> 
    2121      </listitem> 
    2222      <listitem> 
    23         <para><option>[global] server.logTracebacks</option>: controls whether or not tracebacks are written to the log (screen or otherwise).  Defaults to on (True)  If set to False, only a 500 return code will be logged in the access log.</para> 
     23        <para><option>[global] server.log_tracebacks</option>: controls whether or not tracebacks are written to the log (screen or otherwise).  Defaults to on (True)  If set to False, only a 500 return code will be logged in the access log.</para> 
    2424      </listitem> 
    2525      <listitem> 
    26         <para><option>[global] server.maxRequestHeaderSize</option>: maximum acceptable size of a request header, in bytes (defaults to 500KB). If a longer request arrives, the server will interrupt it and return a 413 error. This setting is global (ie: doesn't depend on the path). Set it to zero to remove the limit</para> 
     26        <para><option>[global] server.max_request_header_size</option>: maximum acceptable size of a request header, in bytes (defaults to 500KB). If a longer request arrives, the server will interrupt it and return a 413 error. This setting is global (ie: doesn't depend on the path). Set it to zero to remove the limit</para> 
    2727      </listitem> 
    2828      <listitem> 
    29         <para><option>[/path] server.maxRequestBodySize</option>: maximum acceptable size of a request body, in bytes (defaults to 100MB). If a longer request body arrives, the server will interrupt it and return a 413 error. This setting can be configured per path. This is useful to limit the size of uploaded files. Set it to zero to remove the limit</para> 
     29        <para><option>[/path] server.max_request_body_size</option>: maximum acceptable size of a request body, in bytes (defaults to 100MB). If a longer request body arrives, the server will interrupt it and return a 413 error. This setting can be configured per path. This is useful to limit the size of uploaded files. Set it to zero to remove the limit</para> 
    3030      </listitem> 
    3131      <listitem> 
  • trunk/docs/book/xml/configsystemoverview.xml

    r780 r857  
    2121            # The configuration file called myconfigfile.conf 
    2222            [global] 
    23             server.socketPort=8080 
    24             server.socketHost="" 
    25             server.socketFile="" 
    26             server.socketQueueSize=5 
    27             server.protocolVersion="HTTP/1.0" 
    28             server.logToScreen=True 
    29             server.logFile="" 
    30             server.reverseDNS=False 
    31             server.threadPool=10 
     23            server.socket_port=8080 
     24            server.socket_host="" 
     25            server.socket_file="" 
     26            server.socket_queue_size=5 
     27            server.protocol_version="HTTP/1.0" 
     28            server.log_to_screen=True 
     29            server.log_file="" 
     30            server.reverse_dns=False 
     31            server.thread_pool=10 
    3232            server.environment="development" 
    3333             
    3434            [/service/xmlrpc] 
    35             xmlRpcFilter.on = True 
     35            xmlrpc_filter.on = True 
    3636             
    3737            [/admin] 
    38             sessionAuthenticateFilter.on=True 
     38            session_authenticate_filter.on=True 
    3939             
    4040            [/css/default.css] 
    41             staticFilter.on = True 
    42             staticFilter.file = "data/css/default.css" 
     41            static_filter.on = True 
     42            static_filter.file = "data/css/default.css" 
    4343             
    4444            # From your script... 
     
    5353      settings = {  
    5454         'global': { 
    55             'server.socketPort' : 8080, 
    56             'server.socketHost': "", 
    57             'server.socketFile': "", 
    58             'server.socketQueueSize': 5, 
    59             'server.protocolVersion': "HTTP/1.0", 
    60             'server.logToScreen': True, 
    61             'server.logFile': "", 
    62             'server.reverseDNS': False, 
    63             'server.threadPool': 10, 
     55            'server.socket_port' : 8080, 
     56            'server.socket_host': "", 
     57            'server.socket_file': "", 
     58            'server.socket_queue_size': 5, 
     59            'server.protocol_version': "HTTP/1.0", 
     60            'server.log_to_screen': True, 
     61            'server.log_file': "", 
     62            'server.reverse_dns': False, 
     63            'server.thread_pool': 10, 
    6464            'server.environment': "development" 
    6565         }, 
    6666         '/service/xmlrpc' : { 
    67             'xmlRpcFilter.on': True 
     67            'xmlrpc_filter.on': True 
    6868         }, 
    6969         '/admin': { 
    70             'sessionAuthenticateFilter.on' :True 
     70            'session_authenticate_filter.on' :True 
    7171         }, 
    7272         '/css/default.css': { 
    73             'staticFilter.on': True, 
    74             'staticFilter.file': "data/css/default.css" 
     73            'static_filter.on': True, 
     74            'static_filter.file': "data/css/default.css" 
    7575         } 
    7676      } 
     
    109109                    <itemizedlist> 
    110110                        <listitem> 
    111                             <para>logDebugInfoFilter is enabled</para> 
     111                            <para>log_debug_info_filter is enabled</para> 
    112112                        </listitem> 
    113113                        <listitem> 
    114                             <para>HTTPErrors (and therefore the default _cpOnError) display 
     114                            <para>HTTPErrors (and therefore the default _cp_on_error) display 
    115115                            tracebacks in the browser if errors occur</para> 
    116116                        </listitem> 
     
    127127                    <itemizedlist> 
    128128                        <listitem> 
    129                             <para>logDebugInfoFilter is disabled</para> 
     129                            <para>log_debug_info_filter is disabled</para> 
    130130                        </listitem> 
    131131                        <listitem> 
  • trunk/docs/book/xml/errorhandling.xml

    r840 r857  
    2222      <listitem> 
    2323 
    24         <para><code>beforeErrorResponse</code> filter methods are  
     24        <para><code>before_error_response</code> filter methods are  
    2525        called</para> 
    2626 
     
    2929      <listitem> 
    3030 
    31         <para>a <code>_cpOnError</code> method is called</para> 
     31        <para>a <code>_cp_on_error</code> method is called</para> 
    3232 
    3333      </listitem> 
     
    4141      <listitem> 
    4242 
    43         <para><code>afterErrorResponse</code> filter methods are  
     43        <para><code>after_error_response</code> filter methods are  
    4444        called</para> 
    4545 
     
    4949 
    5050    <para>The error response filter methods are defined by each filter;  
    51     they cannot prevent the call to <code>_cpOnError</code> (unless  
    52     <code>beforeErrorResponse</code> raises an exception, including  
     51    they cannot prevent the call to <code>_cp_on_error</code> (unless  
     52    <code>before_error_response</code> raises an exception, including  
    5353    HTTPRedirect).</para> 
    5454 
    55     <para>The <code>_cpOnError</code> function is a CherryPy  
     55    <para>The <code>_cp_on_error</code> function is a CherryPy  
    5656    &quot;special attribute&quot;; that is, you can define your own  
    57     <code>_cpOnError</code> method for any branch in your  
     57    <code>_cp_on_error</code> method for any branch in your  
    5858    <code>cherrypy.root</code> object tree, and it will be invoked for  
    5959    all child handlers. For example:</para> 
     
    6161    <example> 
    6262 
    63       <title>A custom <code>_cpOnError</code> method</title> 
     63      <title>A custom <code>_cp_on_error</code> method</title> 
    6464 
    6565      <programlisting>import cherrypy 
     
    6767class Root: 
    6868     
    69     def _cpOnError(self): 
     69    def _cp_on_error(self): 
    7070        cherrypy.response.body = (&quot;We apologise for the fault in the website. &quot; 
    7171                                  &quot;Those responsible have been sacked.&quot;) 
     
    7676    </example> 
    7777 
    78     <para>The default <code>_cpOnError</code> function simply responds  
     78    <para>The default <code>_cp_on_error</code> function simply responds  
    7979    as if an HTTPError 500 had been raised (see the next  
    8080    section).</para> 
     
    8585    punts, returning a bare-bones, <code>text/plain</code> error  
    8686    response (containing both tracebacks if  
    87     <code>server.showTracebacks</code> is True).</para> 
     87    <code>server.show_tracebacks</code> is True).</para> 
    8888 
    8989  </section> 
     
    9494 
    9595    <para>HTTPError exceptions do not result in calls to  
    96     <code>_cpOnError</code>. Instead, they have their own  
    97     <code>_cpOnHTTPError</code> function. Like <code>_cpOnError</code>,  
     96    <code>_cp_on_error</code>. Instead, they have their own  
     97    <code>_cp_on_http_error</code> function. Like <code>_cp_on_error</code>,  
    9898    this is a &quot;special attribute&quot; and can be overridden by  
    99     cherrypy.root objects. The default <code>_cpOnHTTPError</code>  
     99    cherrypy.root objects. The default <code>_cp_on_http_error</code>  
    100100    handler sets the HTTP response to a pretty HTML error page.</para> 
    101101 
  • trunk/docs/book/xml/sessions.xml

    r841 r857  
    66  <abstract> 
    77    <para>CherryPy 2.1 includes a powerful sessions system provided via a new 
    8     <literal>sessionFilter</literal>.</para> 
     8    <literal>session_filter</literal>.</para> 
    99  </abstract> 
    1010  <section id="usingsessions"> 
    1111    <title>Using Sessions</title> 
    1212    <para>First you need to enable the session filter through the 
    13     configuration system, by setting <option>sessionFilter.on</option> to 
     13    configuration system, by setting <option>session_filter.on</option> to 
    1414    <literal>True</literal>. This gives you a variable called 
    1515    <literal>cherrypy.session</literal>, which is a dictionary-like object 
     
    3030                index.exposed = True 
    3131 
    32             cherrypy.config.update({'sessionFilter.on': True}) 
     32            cherrypy.config.update({'session_filter.on': True}) 
    3333            cherrypy.root = Root() 
    3434            cherrypy.server.start() 
     
    3939    <title>Configuring sessions</title> 
    4040    <para>The following configuration options are available for 
    41     "sessionFilter":</para> 
     41    "session_filter":</para> 
    4242    <itemizedlist> 
    4343      <listitem> 
    44         <para><option>sessionFilter.on</option>: <literal>True</literal> or 
     44        <para><option>session_filter.on</option>: <literal>True</literal> or 
    4545        <literal>False</literal> (default): enable/disable sessions</para> 
    4646      </listitem> 
    4747      <listitem> 
    48         <para><option>sessionFilter.storageType</option>: Specify which 
     48        <para><option>session_filter.storage_type</option>: Specify which 
    4949        storage type should be used for storing session data on the server. 
    5050        Built-in types are <literal>Ram</literal> (default), 
     
    5353      </listitem> 
    5454      <listitem> 
    55         <para><option>sessionFilter.storagePath</option>: Specifies the directory  
    56         in which CherryPy puts the session files when sessionFilter.storageType is set 
     55        <para><option>session_filter.storage_path</option>: Specifies the directory  
     56        in which CherryPy puts the session files when session_filter.storage_type is set 
    5757        to <literal>File</literal>.</para> 
    5858      </listitem> 
    5959      <listitem> 
    60         <para><option>sessionFilter.timeout</option>: The number of minutes of 
     60        <para><option>session_filter.timeout</option>: The number of minutes of 
    6161        inactivity before an individual session can be removed. It can be a 
    6262        float (ex: 0.5 for 30 seconds). Defaults to 60.</para> 
    6363      </listitem> 
    6464      <listitem> 
    65         <para><option>sessionFilter.cleanUpDelay</option>: Once in a while the 
     65        <para><option>session_filter.clean_up_delay</option>: Once in a while the 
    6666        server cleans up old/expired sessions. This config option specifies 
    6767        how often this clean up process should happen. The delay is in 
     
    6969      </listitem> 
    7070      <listitem> 
    71         <para><option>sessionFilter.cookieName</option>: The name of the 
     71        <para><option>session_filter.cookie_name</option>: The name of the 
    7272        cookie that CherryPy will use to store the session ID. Defaults to 
    7373        <literal>sessionID</literal>.</para> 
    7474      </listitem> 
    7575      <listitem> 
    76         <para><option>sessionFilter.getDB</option>: See the 
     76        <para><option>session_filter.get_db</option>: See the 
    7777        <option>PostgreSQL</option> backend from <xref 
    7878        linkend="backends" />.</para> 
    7979      </listitem> 
    8080      <listitem> 
    81         <para><option>sessionFilter.deadlockTimeout</option>: See <xref 
     81        <para><option>session_filter.deadlock_timeout</option>: See <xref 
    8282        linkend="concurrent" />.</para> 
    8383      </listitem> 
    8484      <listitem> 
    85         <para><option>sessionFilter.onCreateSession</option>: See <xref 
     85        <para><option>session_filter.on_create_session</option>: See <xref 
    8686        linkend="callbacks" />.</para> 
    8787      </listitem> 
    8888      <listitem> 
    89         <para><option>sessionFilter.onDeleteSession</option>: See <xref 
     89        <para><option>session_filter.on_delete_session</option>: See <xref 
    9090        linkend="callbacks" />.</para> 
    9191      </listitem> 
    9292      <listitem> 
    93         <para><option>sessionFilter.storageClass</option>: See <xref 
     93        <para><option>session_filter.storage_class</option>: See <xref 
    9494        linkend="custombackend" />.</para> 
    9595      </listitem> 
     
    128128                ) 
    129129                </screen> </para> You also need to programmatically set the 
    130       <literal>sessionFilter.getDB</literal> config option to a function that 
     130      <literal>session_filter.get_db</literal> config option to a function that 
    131131      returns a DB connection.</listitem> 
    132132    </itemizedlist> 
     
    147147                        a tuple (data, expirationTime) (even if the session is 
    148148                        expired). Return None if id doesn't exist. """ 
    149                 def cleanUp(self): 
     149                def clean_up(self): 
    150150                    """ Delete expired session data from storage and call 
    151                         'onDeleteSession' for each deleted session id """ 
     151                        'on_delete_session' for each deleted session id """ 
    152152            </screen> Note that if you want to use <option>explicit</option> 
    153153    locking (see <xref linkend="concurrent" />), you also have to implement 
    154     two extra methods: <literal>acquireLock</literal> and 
    155     <literal>releaseLock</literal>.</para> 
     154    two extra methods: <literal>acquire_lock</literal> and 
     155    <literal>release_lock</literal>.</para> 
    156156    <para>Once you have written this class, you have to programmatically set 
    157     the <literal>sessionFilter.storageClass</literal> config option to this 
     157    the <literal>session_filter.storage_class</literal> config option to this 
    158158    class.</para> 
    159159    <para>If you need help in writing your own custom backend it is a good 
     
    173173    is serialized. This way, threads can't both modify the data at the same 
    174174    time and leave it in an inconsistent state.</para> 
    175     <para>You can easily make CherryPy serialize access to the session data by setting the <option>sessionFilter.locking</option> config option to <literal>implicit</literal> (the default is <literal>explicit</literal>, which means that CherryPy won't do any locking for you). In the <literal>implicit</literal> mode, 
     175    <para>You can easily make CherryPy serialize access to the session data by setting the <option>session_filter.locking</option> config option to <literal>implicit</literal> (the default is <literal>explicit</literal>, which means that CherryPy won't do any locking for you). In the <literal>implicit</literal> mode, 
    176176    if a browser makes a second request while a first request is still being 
    177177    handled by the server, the second request will block while the first 
     
    183183  <section id="callbacks"> 
    184184    <title>Being notified when sessions are created/deleted</title> 
    185     <para>It is possible to configure the <literal>sessionFilter</literal> so 
     185    <para>It is possible to configure the <literal>session_filter</literal> so 
    186186    that it calls some special callback functions from your code when sessions 
    187187    are being created/deleted. To do so you have to set the 
    188     <literal>sessionFilter.onCreateSession</literal> and 
    189     <literal>sessionFilter.onDeleteSession</literal> config options. When a 
     188    <literal>session_filter.on_create_session</literal> and 
     189    <literal>session_filter.on_delete_session</literal> config options. When a 
    190190    session is created/deleted, CherryPy will call these functions and pass 
    191191    them the session data.</para> 
  • trunk/docs/book/xml/staticcontenthandling.xml

    r627 r857  
    55         xml:id="globaloverviewcherrypy"> 
    66  <title>Static content handling</title> 
    7   <para>Static content is now handled by a filter called "staticFilter" that 
     7  <para>Static content is now handled by a filter called "static_filter" that 
    88  can easily be enabled and configured in your config file. For instance, if 
    99  you wanted to serve <code>/style.css</code> from 
     
    1515    <programlisting> 
    1616            [global] 
    17             staticFilter.root = "/home/site" 
     17            static_filter.root = "/home/site" 
    1818             
    1919            [/style.css] 
    20             staticFilter.on = True 
    21             staticFilter.file = "style.css" 
     20            static_filter.on = True 
     21            static_filter.file = "style.css" 
    2222             
    2323            [/static] 
    24             staticFilter.on = True 
    25             staticFilter.dir = "static" 
     24            static_filter.on = True 
     25            static_filter.dir = "static" 
    2626        </programlisting> 
    2727  </example> 
    28   <para>The <code>staticFilter.root</code> entry can be either absolute or 
     28  <para>The <code>static_filter.root</code> entry can be either absolute or 
    2929  relative. If absolute, static content is sought within that absolute path. 
    3030  Since CherryPy cannot guess where your application root is located, relative 
  • trunk/docs/book/xml/usingfilters.xml

    r797 r857  
    2727    <programlisting linenumbering="numbered"> 
    2828        [/entries/view] 
    29         tidyFilter.on = True 
    30         tidyFilter.tmpDir = "/tmp" 
    31         tidyFilter.strictXml = True 
     29        tidy_filter.on = True 
     30        tidy_filter.tmp_dir = "/tmp" 
     31        tidy_filter.strict_xml = True 
    3232      </programlisting> 
    3333  </example> 
     
    3939  developer reference chapter. However, the way to use them is different from 
    4040  the default filters. You do not declare custom filters within the 
    41   configuration file; instead, use the <code>_cpFilterList</code> attribute in 
     41  configuration file; instead, use the <code>_cp_filters</code> attribute in 
    4242  your source code:</para> 
    4343  <example> 
     
    4848         
    4949        class Entry: 
    50           _cpFilterList = [ MyFilterClass() ] 
     50          _cp_filters = [ MyFilterClass() ] 
    5151          def view(self, id):  
    5252            # do suff... 
     
    6262  <para>As all objects below <code>cherrypy.root.entries</code> will inherit 
    6363  the filter, there is no need to re-specify it in each 
    64   <code>_cpFilterList</code> underneath.</para> 
     64  <code>_cp_filters</code> underneath.</para> 
    6565  <para>Keep in mind that the user-defined filters are called in the order you 
    6666  add them to the list.</para> 

Hosted by WebFaction

Log in as guest/cpguest to create tickets