Commit 1c1d9186 authored by Jim Fulton's avatar Jim Fulton

Fixed bug in getting web_objects.

parent da26c4b1
...@@ -444,7 +444,7 @@ Publishing a module using the ILU Requestor (future) ...@@ -444,7 +444,7 @@ Publishing a module using the ILU Requestor (future)
o Configure the web server to call module_name@server_name with o Configure the web server to call module_name@server_name with
the requestor. the requestor.
$Id: Publish.py,v 1.7 1996/07/11 19:39:07 jfulton Exp $""" $Id: Publish.py,v 1.8 1996/07/18 14:59:54 jfulton Exp $"""
#' #'
# Copyright # Copyright
# #
...@@ -497,6 +497,9 @@ $Id: Publish.py,v 1.7 1996/07/11 19:39:07 jfulton Exp $""" ...@@ -497,6 +497,9 @@ $Id: Publish.py,v 1.7 1996/07/11 19:39:07 jfulton Exp $"""
# (540) 371-6909 # (540) 371-6909
# #
# $Log: Publish.py,v $ # $Log: Publish.py,v $
# Revision 1.8 1996/07/18 14:59:54 jfulton
# Fixed bug in getting web_objects.
#
# Revision 1.7 1996/07/11 19:39:07 jfulton # Revision 1.7 1996/07/11 19:39:07 jfulton
# Fixed bug in new feature: 'AUTHENTICATED_USER' # Fixed bug in new feature: 'AUTHENTICATED_USER'
# #
...@@ -523,7 +526,7 @@ $Id: Publish.py,v 1.7 1996/07/11 19:39:07 jfulton Exp $""" ...@@ -523,7 +526,7 @@ $Id: Publish.py,v 1.7 1996/07/11 19:39:07 jfulton Exp $"""
# #
# #
# #
__version__='$Revision: 1.7 $'[11:-2] __version__='$Revision: 1.8 $'[11:-2]
def main(): def main():
...@@ -613,7 +616,7 @@ class ModulePublisher: ...@@ -613,7 +616,7 @@ class ModulePublisher:
exec 'import %s' % module_name in dict exec 'import %s' % module_name in dict
theModule=object=dict[module_name] theModule=object=dict[module_name]
if hasattr(theModule,published): if hasattr(theModule,published):
object=getattr(dict,published) object=getattr(theModule,published)
else: else:
object=theModule object=theModule
published=None published=None
...@@ -635,9 +638,27 @@ class ModulePublisher: ...@@ -635,9 +638,27 @@ class ModulePublisher:
path=(string.strip(self.env('PATH_INFO')) or '/')[1:] path=(string.strip(self.env('PATH_INFO')) or '/')[1:]
path=string.splitfields(path,'/') path=string.splitfields(path,'/')
while path and not path[0]: path = path[1:] while path and not path[0]: path = path[1:]
# Make help the default, if nothing is specified: # Get default doc:
if not path: path = ['help'] try: doc=object.__doc__
except:
try: doc=object['__doc__']
except: doc=None
# Get default object if no path was specified:
if not path:
for entry_name in 'index_html', 'index.html':
try:
if hasattr(object,entry_name):
path=[entry_name]
break
except: pass
try:
if object.has_key(entry_name):
path=[entry_name]
break
except: pass
if not path: path = ['help']
while path: while path:
entry_name,path,groups=path[0], path[1:], None entry_name,path,groups=path[0], path[1:], None
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment