1- # $Id: client.py,v 1.13 2002-09-05 04:46:36 richard Exp $
1+ # $Id: client.py,v 1.14 2002-09-05 05:25:23 richard Exp $
22
33__doc__ = """
44WWW request handler (also used in the stand-alone server).
@@ -100,7 +100,23 @@ def __init__(self, instance, request, env, form=None):
100100 self .debug = 0
101101
102102 def main (self ):
103- ''' Wrap the request and handle unauthorised requests
103+ ''' Process a request.
104+
105+ The most common requests are handled like so:
106+ 1. figure out who we are, defaulting to the "anonymous" user
107+ see determine_user
108+ 2. figure out what the request is for - the context
109+ see determine_context
110+ 3. handle any requested action (item edit, search, ...)
111+ see handle_action
112+ 4. render a template, resulting in HTML output
113+
114+ In some situations, exceptions occur:
115+ - HTTP Redirect (generally raised by an action)
116+ - SendFile (generally raised by determine_context)
117+ - SendStaticFile (generally raised by determine_context)
118+ - Unauthorised (raised pretty much anywhere it needs to be)
119+ - NotFound (see above... percolates up to the CGI interface)
104120 '''
105121 self .content_action = None
106122 self .ok_message = []
@@ -110,8 +126,8 @@ def main(self):
110126 self .determine_user ()
111127 # figure out the context and desired content template
112128 self .determine_context ()
113- # possibly handle a form submit action (may change self.message,
114- # self.classname and self.template)
129+ # possibly handle a form submit action (may change self.classname
130+ # and self.template, and may also append error/ok_messages )
115131 self .handle_action ()
116132 # now render the page
117133 if self .form .has_key (':contentonly' ):
0 commit comments