[Fix] caldav,document,document_ftp,document_webdav: fix buildbot warnings

bzr revid: sbh@tinyerp.com-20101112114946-u19wkxzh1vj33sol
This commit is contained in:
sbh (Open ERP) 2010-11-12 17:19:46 +05:30
parent 0e5cbfe79a
commit 3389c99ee6
6 changed files with 7 additions and 14 deletions

View File

@ -19,17 +19,15 @@
#
##############################################################################
import time
from document_webdav import nodes
from document.nodes import _str2time, nodefd_static
import logging
import StringIO
from orm_utils import get_last_modified
try:
from tools.dict_tools import dict_merge, dict_merge2
from tools.dict_tools import dict_merge2
except ImportError:
from document.dict_tools import dict_merge, dict_merge2
from document.dict_tools import dict_merge2
# TODO: implement DAV-aware errors, inherit from IOError
@ -392,7 +390,7 @@ class node_calendar(nodes.node_class):
try:
calendar = calendar_obj.browse(cr, uid, self.calendar_id, context=ctx)
return calendar.description or calendar.name
except Exception, e:
except Exception:
return None
def _get_dav_supported_report_set(self, cr):

View File

@ -23,7 +23,6 @@
from osv import osv, fields
from osv.orm import except_orm
import os
import nodes
from tools.translate import _
@ -217,7 +216,6 @@ class document_directory(osv.osv):
"""Check what permission user 'uid' has on directory 'id'
"""
assert len(ids) == 1
id = ids[0]
res = 0
for pperms in [('read', 5), ('write', 2), ('unlink', 8)]:

View File

@ -542,7 +542,7 @@ class node_dir(node_database):
for dfld in dirr.dctx_ids:
try:
self.dctx['dctx_' + dfld.field] = safe_eval(dfld.expr,dc2)
except Exception:
except Exception,e:
print "Cannot eval %s" % dfld.expr
print e
pass
@ -907,7 +907,7 @@ class node_res_obj(node_class):
for fld,expr in self.dctx_dict.items():
try:
self.dctx[fld] = safe_eval(expr, dc2)
except Exception:
except Exception,e:
print "Cannot eval %s for %s" % (expr, fld)
print e
pass

View File

@ -150,7 +150,7 @@ class abstracted_fs(object):
return ret
except EnvironmentError:
raise
except Exception,e:
except Exception:
self._log.exception('Cannot locate item %s at node %s', objname, repr(node))
pass

View File

@ -32,7 +32,6 @@
# code taken from the 'http-client.py' script:
# http://git.hellug.gr/?p=xrg/openerp;a=history;f=tests/http-client.py;hb=refs/heads/xrg-60
import re
import gzip
import logging
import xml.dom.minidom

View File

@ -28,7 +28,6 @@
import netsvc
import tools
from dav_fs import openerp_dav_handler
from tools.config import config
from DAV.WebDAVServer import DAVRequestHandler
@ -37,7 +36,7 @@ from BaseHTTPServer import BaseHTTPRequestHandler
import urlparse
import urllib
import re
from string import atoi,split
from string import atoi
from DAV.errors import *
# from DAV.constants import DAV_VERSION_1, DAV_VERSION_2
@ -99,7 +98,6 @@ class DAVHandler(HttpOptions, FixSendError, DAVRequestHandler):
""" Our uri scheme removes the /webdav/ component from there, so we
need to mangle the header, too.
"""
dest = self.headers['Destination']
up = urlparse.urlparse(urllib.unquote(self.headers['Destination']))
if up.path.startswith(self.davpath):
self.headers['Destination'] = up.path[len(self.davpath):]