← Back to team overview

openerp-community-reviewer team mailing list archive

[Merge] lp:~yann-papouin/ocb-addons/6.1-bug-1008513-dav-import-error into lp:ocb-addons/6.1

 

Yann Papouin has proposed merging lp:~yann-papouin/ocb-addons/6.1-bug-1008513-dav-import-error into lp:ocb-addons/6.1.

Requested reviews:
  OpenERP Community Backports (ocb)
Related bugs:
  Bug #1008513 in OpenERP Community Backports (Addons): "[6.1]document_webdav - pywebdav import error if pywebdav>=0.9.8"
  https://bugs.launchpad.net/ocb-addons/+bug/1008513

For more details, see:
https://code.launchpad.net/~yann-papouin/ocb-addons/6.1-bug-1008513-dav-import-error/+merge/219794

Backport from 7.0 needed to run OpenERP 6.1 with DAV support on latest Linux distribution
-- 
https://code.launchpad.net/~yann-papouin/ocb-addons/6.1-bug-1008513-dav-import-error/+merge/219794
Your team OpenERP Community Backports is requested to review the proposed merge of lp:~yann-papouin/ocb-addons/6.1-bug-1008513-dav-import-error into lp:ocb-addons/6.1.
=== modified file 'document_webdav/dav_fs.py'
--- document_webdav/dav_fs.py	2011-12-19 16:54:40 +0000
+++ document_webdav/dav_fs.py	2014-05-16 08:45:40 +0000
@@ -27,13 +27,19 @@
 
 import netsvc
 import urlparse
-
-from DAV.constants import COLLECTION  #, OBJECT
-from DAV.errors import DAV_Error, DAV_Forbidden, DAV_NotFound
-from DAV.iface import dav_interface
 import urllib
 
-from DAV.davcmd import copyone, copytree, moveone, movetree, delone, deltree
+try:
+    from pywebdav.lib.constants import COLLECTION  # , OBJECT
+    from pywebdav.lib.errors import DAV_Error, DAV_Forbidden, DAV_NotFound
+    from pywebdav.lib.iface import dav_interface
+    from pywebdav.lib.davcmd import copyone, copytree, moveone, movetree, delone, deltree
+except ImportError:
+    from DAV.constants import COLLECTION  #, OBJECT
+    from DAV.errors import DAV_Error, DAV_Forbidden, DAV_NotFound
+    from DAV.iface import dav_interface
+    from DAV.davcmd import copyone, copytree, moveone, movetree, delone, deltree
+    
 from cache import memoize
 from tools import misc
 

=== modified file 'document_webdav/webdav.py'
--- document_webdav/webdav.py	2011-12-19 16:54:40 +0000
+++ document_webdav/webdav.py	2014-05-16 08:45:40 +0000
@@ -30,11 +30,13 @@
 from tools.translate import _
 
 try:
+    from pywebdav.lib import utils
+    from pywebdav.lib.propfind import PROPFIND
+    from pywebdav.lib.report import REPORT
+except ImportError:
     from DAV import utils
     from DAV.propfind import PROPFIND
     from DAV.report import REPORT
-except ImportError:
-    raise osv.except_osv(_('PyWebDAV Import Error!'), _('Please install PyWebDAV from http://code.google.com/p/pywebdav/downloads/detail?name=PyWebDAV-0.9.4.tar.gz&can=2&q=/'))
 
 import tools
 

=== modified file 'document_webdav/webdav_server.py'
--- document_webdav/webdav_server.py	2012-02-09 09:06:22 +0000
+++ document_webdav/webdav_server.py	2014-05-16 08:45:40 +0000
@@ -38,7 +38,6 @@
 import netsvc
 from dav_fs import openerp_dav_handler
 from tools.config import config
-from DAV.WebDAVServer import DAVRequestHandler
 from service import http_server
 from service.websrv_lib import FixSendError, HttpOptions
 from BaseHTTPServer import BaseHTTPRequestHandler
@@ -48,13 +47,20 @@
 import time
 from string import atoi
 import addons
-from DAV.utils import IfParser, TagList
-from DAV.errors import DAV_Error, DAV_Forbidden, DAV_NotFound
-from DAV.propfind import PROPFIND
-# from DAV.constants import DAV_VERSION_1, DAV_VERSION_2
 from xml.dom import minidom
 from redirect import RedirectHTTPHandler
 
+try:
+    from pywebdav.lib.WebDAVServer import DAVRequestHandler
+    from pywebdav.lib.utils import IfParser, TagList
+    from pywebdav.lib.errors import DAV_Error, DAV_Forbidden, DAV_NotFound
+    from pywebdav.lib.propfind import PROPFIND
+except ImportError:
+    from DAV.WebDAVServer import DAVRequestHandler
+    from DAV.utils import IfParser, TagList
+    from DAV.errors import DAV_Error, DAV_Forbidden, DAV_NotFound
+    from DAV.propfind import PROPFIND
+
 khtml_re = re.compile(r' KHTML/([0-9\.]+) ')
 
 def OpenDAVConfig(**kw):


Follow ups