import time
from string import joinfields, split, lower
-from service import security
-
import netsvc
import urlparse
from DAV.davcmd import copyone, copytree, moveone, movetree, delone, deltree
from cache import memoize
from tools import misc
+from tools.dict_tools import dict_merge2
+
CACHE_SIZE=20000
#hack for urlparse: add webdav in the net protocols
return props
node = self.uri2object(cr, uid, pool, uri2)
if node:
- props = props.copy()
- props.update(node.get_dav_props(cr))
+ props = dict_merge2(props, node.get_dav_props(cr))
cr.close()
return props
self.parent.log_message("Exc: %s",traceback.format_exc())
raise default_exc("Operation failed")
- def _get_dav_lockdiscovery(self, uri):
- raise DAV_NotFound
+ #def _get_dav_lockdiscovery(self, uri):
+ # raise DAV_NotFound
- def _get_dav_supportedlock(self, uri):
- raise DAV_NotFound
+ #def A_get_dav_supportedlock(self, uri):
+ # raise DAV_NotFound
def match_prop(self, uri, match, ns, propname):
if self.M_NS.has_key(ns):
else:
fp = node.full_path()
if fp and len(fp):
- self.parent.log_message('childs: @%s' % fp)
fp = '/'.join(fp)
+ self.parent.log_message('childs for: %s' % fp)
else:
fp = None
domain = None
from document import nodes
from tools.safe_eval import safe_eval as eval
+from tools.dict_tools import dict_filter
import urllib
-def dict_filter(srcdic, keys, res=None):
- ''' Return a copy of srcdic that has only keys set.
- If any of keys are missing from srcdic, the result won't have them,
- either.
- @param res If given, result will be updated there, instead of a new dict.
- '''
- if res is None:
- res = {}
- for k in keys:
- if k in srcdic:
- res[k] = srcdic[k]
- return res
class node_acl_mixin(object):
def _get_dav_owner(self, cr):
class DAVHandler(HttpOptions, FixSendError, DAVRequestHandler):
verbose = False
protocol_version = 'HTTP/1.1'
- _HTTP_OPTIONS= { 'DAV' : ['1',],
+ _HTTP_OPTIONS= { 'DAV' : ['1', '2'],
'Allow' : [ 'GET', 'HEAD', 'COPY', 'MOVE', 'POST', 'PUT',
'PROPFIND', 'PROPPATCH', 'OPTIONS', 'MKCOL',
'DELETE', 'TRACE', 'REPORT', ]
handler.debug = config.get_misc('webdav','debug',True)
_dc = { 'verbose' : verbose,
'directory' : directory,
- 'lockemulation' : False,
-
+ 'lockemulation' : True,
}
conf = OpenDAVConfig(**_dc)