comparison roundup/cgi/client.py @ 1053:b28393def972

more explanatory docsting
author Richard Jones <richard@users.sourceforge.net>
date Thu, 05 Sep 2002 04:46:36 +0000
parents a0c7df67dd9c
children 3d8ea16347aa
comparison
equal deleted inserted replaced
1052:d7ded699095a 1053:b28393def972
1 # $Id: client.py,v 1.12 2002-09-05 01:27:42 richard Exp $ 1 # $Id: client.py,v 1.13 2002-09-05 04:46:36 richard Exp $
2 2
3 __doc__ = """ 3 __doc__ = """
4 WWW request handler (also used in the stand-alone server). 4 WWW request handler (also used in the stand-alone server).
5 """ 5 """
6 6
190 190
191 # reopen the database as the correct user 191 # reopen the database as the correct user
192 self.opendb(self.user) 192 self.opendb(self.user)
193 193
194 def determine_context(self, dre=re.compile(r'([^\d]+)(\d+)')): 194 def determine_context(self, dre=re.compile(r'([^\d]+)(\d+)')):
195 ''' Determine the context of this page: 195 ''' Determine the context of this page from the URL:
196 196
197 home (default if no url is given) 197 The URL path after the instance identifier is examined. The path
198 classname 198 is generally only one entry long.
199 designator (classname and nodeid) 199
200 200 - if there is no path, then we are in the "home" context.
201 The desired template to be rendered is also determined There 201 * if the path is "_file", then the additional path entry
202 are two exceptional contexts: 202 specifies the filename of a static file we're to serve up
203 203 from the instance "html" directory. Raises a SendStaticFile
204 _file - serve up a static file 204 exception.
205 path len > 1 - serve up a FileClass content 205 - if there is something in the path (eg "issue"), it identifies
206 (the additional path gives the browser a 206 the tracker class we're to display.
207 nicer filename to save as) 207 - if the path is an item designator (eg "issue123"), then we're
208 to display a specific item.
209 * if the path starts with an item designator and is longer than
210 one entry, then we're assumed to be handling an item of a
211 FileClass, and the extra path information gives the filename
212 that the client is going to label the download with (ie
213 "file123/image.png" is nicer to download than "file123"). This
214 raises a SendFile exception.
215
216 Both of the "*" types of contexts stop before we bother to
217 determine the template we're going to use. That's because they
218 don't actually use templates.
208 219
209 The template used is specified by the :template CGI variable, 220 The template used is specified by the :template CGI variable,
210 which defaults to: 221 which defaults to:
222
211 only classname suplied: "index" 223 only classname suplied: "index"
212 full item designator supplied: "item" 224 full item designator supplied: "item"
213 225
214 We set: 226 We set:
215 self.classname - the class to display, can be None 227 self.classname - the class to display, can be None

Roundup Issue Tracker: http://roundup-tracker.org/