summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8207df3)
raw | patch | inline | side by side (parent: 8207df3)
author | dman13 <dman13@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Wed, 12 Jun 2002 00:59:44 +0000 (00:59 +0000) | ||
committer | dman13 <dman13@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Wed, 12 Jun 2002 00:59:44 +0000 (00:59 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@778 57a73879-2fb5-44c3-a270-3262357dd7e2
frontends/ZRoundup/ZRoundup.py | patch | blob | history |
index 5a40435e770355a9962455203733bb0938b932ea..371719dcec0c2dd1994e5d5c8d250958958f0724 100644 (file)
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: ZRoundup.py,v 1.5 2002-05-14 23:36:25 richard Exp $
+# $Id: ZRoundup.py,v 1.6 2002-06-12 00:59:44 dman13 Exp $
#
''' ZRoundup module - exposes the roundup web interface to Zope
instance = roundup.instance.open(self.instance_home)
request = RequestWrapper(self.REQUEST['RESPONSE'])
env = self.REQUEST.environ
- env['SCRIPT_NAME'] = '/'.join(self.getPhysicalPath()[:-1])
- env['INSTANCE_NAME'] = self.id
+
+ # figure out the path components to set
+ import urlparse
+ path = urlparse.urlparse( self.absolute_url() )[2]
+ path_components = path.split( '/' )
+
+ # special case when roundup is '/' in this virtual host,
+ if path == "/" :
+ env['SCRIPT_NAME'] = "/"
+ env['INSTANCE_NAME'] = ''
+ else :
+ # all but the last element is the path
+ env['SCRIPT_NAME'] = '/'.join( path_components[:-1] )
+ # the last element is the name
+ env['INSTANCE_NAME'] = path_components[-1]
+ del path_components , path
+
if env['REQUEST_METHOD'] == 'GET':
# force roundup to re-parse the request because Zope fiddles
# with it and we lose all the :filter, :columns, etc goodness
#
# $Log: not supported by cvs2svn $
+# Revision 1.5 2002/05/14 23:36:25 richard
+# . fixed SCRIPT_NAME in ZRoundup for instances not at top level of Zope
+# (thanks dman)
+#
# Revision 1.4 2002/01/10 03:38:16 richard
# reformatting for 80 cols
#