Changeset 857
- Timestamp:
- 12/05/05 09:22:16
- Files:
-
- trunk/docs/book/xml/apireference.xml (modified) (17 diffs)
- trunk/docs/book/xml/builtinfilters.xml (modified) (8 diffs)
- trunk/docs/book/xml/configreference.xml (modified) (1 diff)
- trunk/docs/book/xml/configsystemoverview.xml (modified) (4 diffs)
- trunk/docs/book/xml/errorhandling.xml (modified) (9 diffs)
- trunk/docs/book/xml/sessions.xml (modified) (9 diffs)
- trunk/docs/book/xml/staticcontenthandling.xml (modified) (2 diffs)
- trunk/docs/book/xml/usingfilters.xml (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/docs/book/xml/apireference.xml
r856 r857 389 389 use this to automatically select between the CherryHTTPServer 390 390 and the PooledThreadServer based on the value of 391 config.get("server.thread Pool") and392 config.get("server.socket File").</para>391 config.get("server.thread_pool") and 392 config.get("server.socket_file").</para> 393 393 394 394 </listitem> … … 548 548 <section> 549 549 550 <title>cherrypy.server.on StartServerList</title>550 <title>cherrypy.server.on_start_server_list</title> 551 551 552 552 <para>A list of functions that will be called when the server … … 557 557 <section> 558 558 559 <title>cherrypy.server.on StopServerList</title>559 <title>cherrypy.server.on_stop_server_list</title> 560 560 561 561 <para>A list of functions that will be called when the server … … 566 566 <section> 567 567 568 <title>cherrypy.server.on StartThreadList</title>568 <title>cherrypy.server.on_start_thread_list</title> 569 569 570 570 <para>A list of functions that will be called when each request … … 572 572 started or controlled by CherryPy; for example, when using 573 573 CherryPy with mod_python, Apache will start and stop the request 574 threads. Nevertheless, CherryPy will run the on StartThreadList574 threads. Nevertheless, CherryPy will run the on_start_thread_list 575 575 functions upon the first request using each distinct 576 576 thread.</para> … … 580 580 <section> 581 581 582 <title>cherrypy.server.on StopThreadList</title>582 <title>cherrypy.server.on_stop_thread_list</title> 583 583 584 584 <para>A list of functions that will be called when each request … … 767 767 <section> 768 768 769 <title> HeaderMap</title>769 <title>headers</title> 770 770 771 771 <para>A subclass of Python's builtin <code>dict</code> … … 926 926 <section> 927 927 928 <title>_cp OnError</title>929 930 <para>_cp OnError is a function for handling unanticipated928 <title>_cp_on_error</title> 929 930 <para>_cp_on_error is a function for handling unanticipated 931 931 exceptions, whether raised by CherryPy itself, or in user 932 932 applications. The default simply responds as if HTTPError(500) … … 937 937 <section> 938 938 939 <title>_cp OnHTTPError</title>940 941 <para>_cp OnHTTPError handles HTTPError responses, setting939 <title>_cp_on_http_error</title> 940 941 <para>_cp_on_http_error handles HTTPError responses, setting 942 942 cherrypy.response.status, headers, and body.</para> 943 943 … … 946 946 <section> 947 947 948 <title>_cp FilterList</title>948 <title>_cp_filters</title> 949 949 950 950 <para>User defined filters are enabled using the class attribute 951 _cp FilterList. Any filter instances placed in _cpFilterListwill951 _cp_filters. Any filter instances placed in _cp_filters will 952 952 be applied to all methods of the class.</para> 953 953 … … 956 956 <section> 957 957 958 <title>_cp LogAccess</title>958 <title>_cp_log_access</title> 959 959 960 960 <para>Function to log HTTP requests into the access.log … … 982 982 <section> 983 983 984 <title>on StartResource</title>984 <title>on_start_resource</title> 985 985 <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> 986 986 <para>This hook is always called.</para> … … 989 989 <section> 990 990 991 <title>before RequestBody</title>991 <title>before_request_body</title> 992 992 <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. 993 993 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> … … 1001 1001 <section> 1002 1002 1003 <title>before Main</title>1003 <title>before_main</title> 1004 1004 <para>This hook is called right before your page handler (exposed callable) is being called by CherryPy. 1005 1005 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> … … 1009 1009 <section> 1010 1010 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.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. 1013 1013 It helps you for example to check for what could have been returned by your page handler and change some headers of needed.</para> 1014 1014 <para>This hook is not called if an error occurs during the process before hand.</para> … … 1017 1017 <section> 1018 1018 1019 <title>on EndResource</title>1019 <title>on_end_resource</title> 1020 1020 <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> 1021 1021 <para>This hook is always called.</para> … … 1024 1024 <section> 1025 1025 1026 <title>before ErrorResponse</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 OnError handler is being called as well as the response finalizing stage.</para>1028 </section> 1029 1030 <section> 1031 1032 <title>after ErrorResponse</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 OnError 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> 1034 1034 </section> 1035 1035 trunk/docs/book/xml/builtinfilters.xml
r822 r857 10 10 <itemizedlist> 11 11 <listitem> 12 <para>base UrlFilter.baseUrl</para>12 <para>base_url_filter.base_url</para> 13 13 </listitem> 14 14 <listitem> 15 <para>base UrlFilter.useXForwardedHost</para>15 <para>base_url_filter.use_x_forwarded_host</para> 16 16 </listitem> 17 17 </itemizedlist> … … 28 28 <itemizedlist> 29 29 <listitem> 30 <para>decoding Filter.encoding</para>30 <para>decoding_filter.encoding</para> 31 31 </listitem> 32 32 </itemizedlist> … … 38 38 <itemizedlist> 39 39 <listitem> 40 <para>encoding Filter.encoding: Force all text responses to be encoded with this40 <para>encoding_filter.encoding: Force all text responses to be encoded with this 41 41 encoding.</para> 42 42 </listitem> 43 43 <listitem> 44 <para>encoding Filter.defaultEncoding: Default all text responses to this encoding (if44 <para>encoding_filter.default_encoding: Default all text responses to this encoding (if 45 45 the user-agent does not request otherwise).</para> 46 46 </listitem> … … 60 60 <itemizedlist> 61 61 <listitem> 62 <para>log DebugInfoFilter.mimeTypeList, ['text/html']</para>62 <para>log_debug_info_filter.mime_types, ['text/html']</para> 63 63 </listitem> 64 64 <listitem> 65 <para>log DebugInfoFilter.logAsComment, False</para>65 <para>log_debug_info_filter.log_as_comment, False</para> 66 66 </listitem> 67 67 <listitem> 68 <para>log DebugInfoFilter.logBuildTime, True</para>68 <para>log_debug_info_filter.log_build_time, True</para> 69 69 </listitem> 70 70 <listitem> 71 <para>log DebugInfoFilter.logPageSize, True</para>71 <para>log_debug_info_filter.log_page_size, True</para> 72 72 </listitem> 73 73 </itemizedlist> … … 79 79 <itemizedlist> 80 80 <listitem> 81 <para>static Filter.file</para>81 <para>static_filter.file</para> 82 82 </listitem> 83 83 <listitem> 84 <para>static Filter.dir</para>84 <para>static_filter.dir</para> 85 85 </listitem> 86 86 <listitem> 87 <para>static Filter.root</para>87 <para>static_filter.root</para> 88 88 </listitem> 89 89 </itemizedlist> … … 102 102 <itemizedlist> 103 103 <listitem> 104 <para>tidy Filter.tmpDir</para>104 <para>tidy_filter.tmp_dir</para> 105 105 </listitem> 106 106 <listitem> 107 <para>tidy Filter.strictXml, False</para>107 <para>tidy_filter.strict_xml, False</para> 108 108 </listitem> 109 109 <listitem> 110 <para>tidy Filter.tidyPath</para>110 <para>tidy_filter.tidy_path</para> 111 111 </listitem> 112 112 </itemizedlist> … … 119 119 <itemizedlist> 120 120 <listitem> 121 <para>virtual HostFilter.prefix, '/'</para>121 <para>virtual_host_filter.prefix, '/'</para> 122 122 </listitem> 123 123 </itemizedlist> … … 126 126 <title>xmlrpcfilter</title> 127 127 <para>The xmlrpcfilter converts XMLRPC to the CherryPy2 object system and vice-versa.</para> 128 <para>PLEASE NOTE: before RequestBody: Unmarshalls the posted data to a methodname and128 <para>PLEASE NOTE: before_request_body: Unmarshalls the posted data to a methodname and 129 129 parameters. - These are stored in cherrypy.request.rpcMethod and .rpcParams - The method is 130 130 also stored in cherrypy.request.path, so CP2 will find the right method to call for you, 131 based on the root's position. before Finalize: Marshalls cherrypy.response.body to xmlrpc. -131 based on the root's position. before_finalize: Marshalls cherrypy.response.body to xmlrpc. - 132 132 Until resolved: cherrypy.response.body must be a python source string; this string is 133 133 'eval'ed to return the results. This will be resolved in the future. - Content-Type and trunk/docs/book/xml/configreference.xml
r677 r857 9 9 <itemizedlist> 10 10 <listitem> 11 <para><option>[global] server.socket Port</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> 12 12 </listitem> 13 13 <listitem> 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>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> 15 15 </listitem> 16 16 <listitem> 17 <para><option>[global] server.log AccessFile</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> 18 18 </listitem> 19 19 <listitem> 20 <para><option>[global] server.log ToScreen</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> 21 21 </listitem> 22 22 <listitem> 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>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> 24 24 </listitem> 25 25 <listitem> 26 <para><option>[global] server.max RequestHeaderSize</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> 27 27 </listitem> 28 28 <listitem> 29 <para><option>[/path] server.max RequestBodySize</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> 30 30 </listitem> 31 31 <listitem> trunk/docs/book/xml/configsystemoverview.xml
r780 r857 21 21 # The configuration file called myconfigfile.conf 22 22 [global] 23 server.socket Port=808024 server.socket Host=""25 server.socket File=""26 server.socket QueueSize=527 server.protocol Version="HTTP/1.0"28 server.log ToScreen=True29 server.log File=""30 server.reverse DNS=False31 server.thread Pool=1023 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 32 32 server.environment="development" 33 33 34 34 [/service/xmlrpc] 35 xml RpcFilter.on = True35 xmlrpc_filter.on = True 36 36 37 37 [/admin] 38 session AuthenticateFilter.on=True38 session_authenticate_filter.on=True 39 39 40 40 [/css/default.css] 41 static Filter.on = True42 static Filter.file = "data/css/default.css"41 static_filter.on = True 42 static_filter.file = "data/css/default.css" 43 43 44 44 # From your script... … … 53 53 settings = { 54 54 'global': { 55 'server.socket Port' : 8080,56 'server.socket Host': "",57 'server.socket File': "",58 'server.socket QueueSize': 5,59 'server.protocol Version': "HTTP/1.0",60 'server.log ToScreen': True,61 'server.log File': "",62 'server.reverse DNS': False,63 'server.thread Pool': 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, 64 64 'server.environment': "development" 65 65 }, 66 66 '/service/xmlrpc' : { 67 'xml RpcFilter.on': True67 'xmlrpc_filter.on': True 68 68 }, 69 69 '/admin': { 70 'session AuthenticateFilter.on' :True70 'session_authenticate_filter.on' :True 71 71 }, 72 72 '/css/default.css': { 73 'static Filter.on': True,74 'static Filter.file': "data/css/default.css"73 'static_filter.on': True, 74 'static_filter.file': "data/css/default.css" 75 75 } 76 76 } … … 109 109 <itemizedlist> 110 110 <listitem> 111 <para>log DebugInfoFilter is enabled</para>111 <para>log_debug_info_filter is enabled</para> 112 112 </listitem> 113 113 <listitem> 114 <para>HTTPErrors (and therefore the default _cp OnError) display114 <para>HTTPErrors (and therefore the default _cp_on_error) display 115 115 tracebacks in the browser if errors occur</para> 116 116 </listitem> … … 127 127 <itemizedlist> 128 128 <listitem> 129 <para>log DebugInfoFilter is disabled</para>129 <para>log_debug_info_filter is disabled</para> 130 130 </listitem> 131 131 <listitem> trunk/docs/book/xml/errorhandling.xml
r840 r857 22 22 <listitem> 23 23 24 <para><code>before ErrorResponse</code> filter methods are24 <para><code>before_error_response</code> filter methods are 25 25 called</para> 26 26 … … 29 29 <listitem> 30 30 31 <para>a <code>_cp OnError</code> method is called</para>31 <para>a <code>_cp_on_error</code> method is called</para> 32 32 33 33 </listitem> … … 41 41 <listitem> 42 42 43 <para><code>after ErrorResponse</code> filter methods are43 <para><code>after_error_response</code> filter methods are 44 44 called</para> 45 45 … … 49 49 50 50 <para>The error response filter methods are defined by each filter; 51 they cannot prevent the call to <code>_cp OnError</code> (unless52 <code>before ErrorResponse</code> raises an exception, including51 they cannot prevent the call to <code>_cp_on_error</code> (unless 52 <code>before_error_response</code> raises an exception, including 53 53 HTTPRedirect).</para> 54 54 55 <para>The <code>_cp OnError</code> function is a CherryPy55 <para>The <code>_cp_on_error</code> function is a CherryPy 56 56 "special attribute"; that is, you can define your own 57 <code>_cp OnError</code> method for any branch in your57 <code>_cp_on_error</code> method for any branch in your 58 58 <code>cherrypy.root</code> object tree, and it will be invoked for 59 59 all child handlers. For example:</para> … … 61 61 <example> 62 62 63 <title>A custom <code>_cp OnError</code> method</title>63 <title>A custom <code>_cp_on_error</code> method</title> 64 64 65 65 <programlisting>import cherrypy … … 67 67 class Root: 68 68 69 def _cp OnError(self):69 def _cp_on_error(self): 70 70 cherrypy.response.body = ("We apologise for the fault in the website. " 71 71 "Those responsible have been sacked.") … … 76 76 </example> 77 77 78 <para>The default <code>_cp OnError</code> function simply responds78 <para>The default <code>_cp_on_error</code> function simply responds 79 79 as if an HTTPError 500 had been raised (see the next 80 80 section).</para> … … 85 85 punts, returning a bare-bones, <code>text/plain</code> error 86 86 response (containing both tracebacks if 87 <code>server.show Tracebacks</code> is True).</para>87 <code>server.show_tracebacks</code> is True).</para> 88 88 89 89 </section> … … 94 94 95 95 <para>HTTPError exceptions do not result in calls to 96 <code>_cp OnError</code>. Instead, they have their own97 <code>_cp OnHTTPError</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>, 98 98 this is a "special attribute" and can be overridden by 99 cherrypy.root objects. The default <code>_cp OnHTTPError</code>99 cherrypy.root objects. The default <code>_cp_on_http_error</code> 100 100 handler sets the HTTP response to a pretty HTML error page.</para> 101 101 trunk/docs/book/xml/sessions.xml
r841 r857 6 6 <abstract> 7 7 <para>CherryPy 2.1 includes a powerful sessions system provided via a new 8 <literal>session Filter</literal>.</para>8 <literal>session_filter</literal>.</para> 9 9 </abstract> 10 10 <section id="usingsessions"> 11 11 <title>Using Sessions</title> 12 12 <para>First you need to enable the session filter through the 13 configuration system, by setting <option>session Filter.on</option> to13 configuration system, by setting <option>session_filter.on</option> to 14 14 <literal>True</literal>. This gives you a variable called 15 15 <literal>cherrypy.session</literal>, which is a dictionary-like object … … 30 30 index.exposed = True 31 31 32 cherrypy.config.update({'session Filter.on': True})32 cherrypy.config.update({'session_filter.on': True}) 33 33 cherrypy.root = Root() 34 34 cherrypy.server.start() … … 39 39 <title>Configuring sessions</title> 40 40 <para>The following configuration options are available for 41 "session Filter":</para>41 "session_filter":</para> 42 42 <itemizedlist> 43 43 <listitem> 44 <para><option>session Filter.on</option>: <literal>True</literal> or44 <para><option>session_filter.on</option>: <literal>True</literal> or 45 45 <literal>False</literal> (default): enable/disable sessions</para> 46 46 </listitem> 47 47 <listitem> 48 <para><option>session Filter.storageType</option>: Specify which48 <para><option>session_filter.storage_type</option>: Specify which 49 49 storage type should be used for storing session data on the server. 50 50 Built-in types are <literal>Ram</literal> (default), … … 53 53 </listitem> 54 54 <listitem> 55 <para><option>session Filter.storagePath</option>: Specifies the directory56 in which CherryPy puts the session files when session Filter.storageType is set55 <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 57 57 to <literal>File</literal>.</para> 58 58 </listitem> 59 59 <listitem> 60 <para><option>session Filter.timeout</option>: The number of minutes of60 <para><option>session_filter.timeout</option>: The number of minutes of 61 61 inactivity before an individual session can be removed. It can be a 62 62 float (ex: 0.5 for 30 seconds). Defaults to 60.</para> 63 63 </listitem> 64 64 <listitem> 65 <para><option>session Filter.cleanUpDelay</option>: Once in a while the65 <para><option>session_filter.clean_up_delay</option>: Once in a while the 66 66 server cleans up old/expired sessions. This config option specifies 67 67 how often this clean up process should happen. The delay is in … … 69 69 </listitem> 70 70 <listitem> 71 <para><option>session Filter.cookieName</option>: The name of the71 <para><option>session_filter.cookie_name</option>: The name of the 72 72 cookie that CherryPy will use to store the session ID. Defaults to 73 73 <literal>sessionID</literal>.</para> 74 74 </listitem> 75 75 <listitem> 76 <para><option>session Filter.getDB</option>: See the76 <para><option>session_filter.get_db</option>: See the 77 77 <option>PostgreSQL</option> backend from <xref 78 78 linkend="backends" />.</para> 79 79 </listitem> 80 80 <listitem> 81 <para><option>session Filter.deadlockTimeout</option>: See <xref81 <para><option>session_filter.deadlock_timeout</option>: See <xref 82 82 linkend="concurrent" />.</para> 83 83 </listitem> 84 84 <listitem> 85 <para><option>session Filter.onCreateSession</option>: See <xref85 <para><option>session_filter.on_create_session</option>: See <xref 86 86 linkend="callbacks" />.</para> 87 87 </listitem> 88 88 <listitem> 89 <para><option>session Filter.onDeleteSession</option>: See <xref89 <para><option>session_filter.on_delete_session</option>: See <xref 90 90 linkend="callbacks" />.</para> 91 91 </listitem> 92 92 <listitem> 93 <para><option>session Filter.storageClass</option>: See <xref93 <para><option>session_filter.storage_class</option>: See <xref 94 94 linkend="custombackend" />.</para> 95 95 </listitem> … … 128 128 ) 129 129 </screen> </para> You also need to programmatically set the 130 <literal>session Filter.getDB</literal> config option to a function that130 <literal>session_filter.get_db</literal> config option to a function that 131 131 returns a DB connection.</listitem> 132 132 </itemizedlist> … … 147 147 a tuple (data, expirationTime) (even if the session is 148 148 expired). Return None if id doesn't exist. """ 149 def clean Up(self):149 def clean_up(self): 150 150 """ Delete expired session data from storage and call 151 'on DeleteSession' for each deleted session id """151 'on_delete_session' for each deleted session id """ 152 152 </screen> Note that if you want to use <option>explicit</option> 153 153 locking (see <xref linkend="concurrent" />), you also have to implement 154 two extra methods: <literal>acquire Lock</literal> and155 <literal>release Lock</literal>.</para>154 two extra methods: <literal>acquire_lock</literal> and 155 <literal>release_lock</literal>.</para> 156 156 <para>Once you have written this class, you have to programmatically set 157 the <literal>session Filter.storageClass</literal> config option to this157 the <literal>session_filter.storage_class</literal> config option to this 158 158 class.</para> 159 159 <para>If you need help in writing your own custom backend it is a good … … 173 173 is serialized. This way, threads can't both modify the data at the same 174 174 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>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,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, 176 176 if a browser makes a second request while a first request is still being 177 177 handled by the server, the second request will block while the first … … 183 183 <section id="callbacks"> 184 184 <title>Being notified when sessions are created/deleted</title> 185 <para>It is possible to configure the <literal>session Filter</literal> so185 <para>It is possible to configure the <literal>session_filter</literal> so 186 186 that it calls some special callback functions from your code when sessions 187 187 are being created/deleted. To do so you have to set the 188 <literal>session Filter.onCreateSession</literal> and189 <literal>session Filter.onDeleteSession</literal> config options. When a188 <literal>session_filter.on_create_session</literal> and 189 <literal>session_filter.on_delete_session</literal> config options. When a 190 190 session is created/deleted, CherryPy will call these functions and pass 191 191 them the session data.</para> trunk/docs/book/xml/staticcontenthandling.xml
r627 r857 5 5 xml:id="globaloverviewcherrypy"> 6 6 <title>Static content handling</title> 7 <para>Static content is now handled by a filter called "static Filter" that7 <para>Static content is now handled by a filter called "static_filter" that 8 8 can easily be enabled and configured in your config file. For instance, if 9 9 you wanted to serve <code>/style.css</code> from … … 15 15 <programlisting> 16 16 [global] 17 static Filter.root = "/home/site"17 static_filter.root = "/home/site" 18 18 19 19 [/style.css] 20 static Filter.on = True21 static Filter.file = "style.css"20 static_filter.on = True 21 static_filter.file = "style.css" 22 22 23 23 [/static] 24 static Filter.on = True25 static Filter.dir = "static"24 static_filter.on = True 25 static_filter.dir = "static" 26 26 </programlisting> 27 27 </example> 28 <para>The <code>static Filter.root</code> entry can be either absolute or28 <para>The <code>static_filter.root</code> entry can be either absolute or 29 29 relative. If absolute, static content is sought within that absolute path. 30 30 Since CherryPy cannot guess where your application root is located, relative trunk/docs/book/xml/usingfilters.xml
r797 r857 27 27 <programlisting linenumbering="numbered"> 28 28 [/entries/view] 29 tidy Filter.on = True30 tidy Filter.tmpDir = "/tmp"31 tidy Filter.strictXml = True29 tidy_filter.on = True 30 tidy_filter.tmp_dir = "/tmp" 31 tidy_filter.strict_xml = True 32 32 </programlisting> 33 33 </example> … … 39 39 developer reference chapter. However, the way to use them is different from 40 40 the default filters. You do not declare custom filters within the 41 configuration file; instead, use the <code>_cp FilterList</code> attribute in41 configuration file; instead, use the <code>_cp_filters</code> attribute in 42 42 your source code:</para> 43 43 <example> … … 48 48 49 49 class Entry: 50 _cp FilterList= [ MyFilterClass() ]50 _cp_filters = [ MyFilterClass() ] 51 51 def view(self, id): 52 52 # do suff... … … 62 62 <para>As all objects below <code>cherrypy.root.entries</code> will inherit 63 63 the filter, there is no need to re-specify it in each 64 <code>_cp FilterList</code> underneath.</para>64 <code>_cp_filters</code> underneath.</para> 65 65 <para>Keep in mind that the user-defined filters are called in the order you 66 66 add them to the list.</para>

