Commit eff0db37 authored by Shane Hathaway's avatar Shane Hathaway

This makes XML-RPC and acquisition work together as well as clarifies a little

WebDAV oddity.
parent 5753dd9f
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
# attributions are listed in the accompanying credits file. # attributions are listed in the accompanying credits file.
# #
############################################################################## ##############################################################################
__version__='$Revision: 1.29 $'[11:-2] __version__='$Revision: 1.30 $'[11:-2]
from string import join, split, find, rfind, lower, upper from string import join, split, find, rfind, lower, upper
from urllib import quote from urllib import quote
...@@ -119,6 +119,7 @@ class BaseRequest: ...@@ -119,6 +119,7 @@ class BaseRequest:
collection of variable to value mappings. collection of variable to value mappings.
""" """
maybe_webdav_client = 1
# While the following assignment is not strictly necessary, it # While the following assignment is not strictly necessary, it
# prevents alot of unnecessary searches because, without it, # prevents alot of unnecessary searches because, without it,
...@@ -257,12 +258,15 @@ class BaseRequest: ...@@ -257,12 +258,15 @@ class BaseRequest:
# How did this request come in? (HTTP GET, PUT, POST, etc.) # How did this request come in? (HTTP GET, PUT, POST, etc.)
method=req_method=upper(request_get('REQUEST_METHOD', 'GET')) method=req_method=upper(request_get('REQUEST_METHOD', 'GET'))
baseflag=0 no_acquire_flag=0
# Set the default method # Set the default method
if method=='GET' or method=='POST': if method=='GET' or method=='POST':
method='index_html' method='index_html'
else: baseflag=1 else:
if self.maybe_webdav_client:
# Probably a WebDAV client.
no_acquire_flag=1
URL=request['URL'] URL=request['URL']
parents=request['PARENTS'] parents=request['PARENTS']
...@@ -339,7 +343,7 @@ class BaseRequest: ...@@ -339,7 +343,7 @@ class BaseRequest:
else: else:
try: try:
# Note - this is necessary to support # Note - no_acquire_flag is necessary to support
# things like DAV. We have to make sure # things like DAV. We have to make sure
# that the target object is not acquired # that the target object is not acquired
# if the request_method is other than GET # if the request_method is other than GET
...@@ -349,7 +353,7 @@ class BaseRequest: ...@@ -349,7 +353,7 @@ class BaseRequest:
# heirarchy -- you'd always get the # heirarchy -- you'd always get the
# existing object :( # existing object :(
if baseflag and hasattr(object, 'aq_base'): if no_acquire_flag and hasattr(object, 'aq_base'):
if hasattr(object.aq_base, entry_name): if hasattr(object.aq_base, entry_name):
subobject=getattr(object, entry_name) subobject=getattr(object, entry_name)
else: raise AttributeError, entry_name else: raise AttributeError, entry_name
......
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
# #
############################################################################## ##############################################################################
__version__='$Revision: 1.36 $'[11:-2] __version__='$Revision: 1.37 $'[11:-2]
import regex, sys, os, string, urllib import regex, sys, os, string, urllib
from string import lower, atoi, rfind, split, strip, join, upper, find from string import lower, atoi, rfind, split, strip, join, upper, find
...@@ -354,6 +354,7 @@ class HTTPRequest(BaseRequest): ...@@ -354,6 +354,7 @@ class HTTPRequest(BaseRequest):
response=xmlrpc.response(response) response=xmlrpc.response(response)
other['RESPONSE']=self.response=response other['RESPONSE']=self.response=response
other['REQUEST_METHOD']='' # We don't want index_html! other['REQUEST_METHOD']='' # We don't want index_html!
self.maybe_webdav_client = 0
else: else:
self._file=fs.file self._file=fs.file
else: else:
......
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