Commit 5a38c6e8 authored by Chris McDonough's avatar Chris McDonough

Reformat whitespace in preparation for a real change.

parent 92a1f1b4
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
__doc__="""Python Object Publisher -- Publish Python objects on web servers __doc__="""Python Object Publisher -- Publish Python objects on web servers
$Id$""" $Id$"""
__version__='$Revision: 1.167 $'[11:-2]
import sys, os import sys, os
from Response import Response from Response import Response
...@@ -85,7 +84,8 @@ def publish(request, module_name, after_list, debug=0, ...@@ -85,7 +84,8 @@ def publish(request, module_name, after_list, debug=0,
raise Redirect, cancel raise Redirect, cancel
after_list[0]=bobo_after after_list[0]=bobo_after
if debug_mode: response.debug_mode=debug_mode if debug_mode:
response.debug_mode=debug_mode
if realm and not request.get('REMOTE_USER',None): if realm and not request.get('REMOTE_USER',None):
response.realm=realm response.realm=realm
...@@ -97,7 +97,8 @@ def publish(request, module_name, after_list, debug=0, ...@@ -97,7 +97,8 @@ def publish(request, module_name, after_list, debug=0,
request['PARENTS']=parents=[object] request['PARENTS']=parents=[object]
if transactions_manager: transactions_manager.begin() if transactions_manager:
transactions_manager.begin()
object=request.traverse(path, validated_hook=validated_hook) object=request.traverse(path, validated_hook=validated_hook)
...@@ -110,13 +111,16 @@ def publish(request, module_name, after_list, debug=0, ...@@ -110,13 +111,16 @@ def publish(request, module_name, after_list, debug=0,
dont_publish_class, dont_publish_class,
request, bind=1) request, bind=1)
if result is not response: response.setBody(result) if result is not response:
response.setBody(result)
if transactions_manager: transactions_manager.commit() if transactions_manager:
transactions_manager.commit()
return response return response
except: except:
if transactions_manager: transactions_manager.abort() if transactions_manager:
transactions_manager.abort()
# DM: provide nicer error message for FTP # DM: provide nicer error message for FTP
sm = None sm = None
...@@ -126,11 +130,13 @@ def publish(request, module_name, after_list, debug=0, ...@@ -126,11 +130,13 @@ def publish(request, module_name, after_list, debug=0,
if sm is not None: if sm is not None:
from asyncore import compact_traceback from asyncore import compact_traceback
cl,val= sys.exc_info()[:2] cl,val= sys.exc_info()[:2]
sm('%s: %s %s' % (getattr(cl,'__name__',cl), val, debug_mode and compact_traceback()[-1] or '')) sm('%s: %s %s' % (
getattr(cl,'__name__',cl), val,
debug_mode and compact_traceback()[-1] or ''))
if err_hook is not None: if err_hook is not None:
if parents: parents=parents[0] if parents:
parents=parents[0]
try: try:
return err_hook(parents, request, return err_hook(parents, request,
sys.exc_info()[0], sys.exc_info()[0],
...@@ -152,7 +158,8 @@ def publish(request, module_name, after_list, debug=0, ...@@ -152,7 +158,8 @@ def publish(request, module_name, after_list, debug=0,
finally: finally:
newrequest.close() newrequest.close()
else: raise else:
raise
def publish_module_standard(module_name, def publish_module_standard(module_name,
......
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