From e8457bd914fb7482dad0bb529f99a34f5b2b1dd8 Mon Sep 17 00:00:00 2001 From: Vo Minh Thu Date: Thu, 9 Aug 2012 14:15:37 +0200 Subject: [PATCH] [FIX] web_linkedin: proper import of the web addons in embedded mode (otherwise it might clash with web.py). bzr revid: vmt@openerp.com-20120809121537-z0pqr9c64bd1kcps --- addons/web_linkedin/web_linkedin.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/addons/web_linkedin/web_linkedin.py b/addons/web_linkedin/web_linkedin.py index acce3c45735..5c8ffc57cb5 100644 --- a/addons/web_linkedin/web_linkedin.py +++ b/addons/web_linkedin/web_linkedin.py @@ -19,14 +19,20 @@ # ############################################################################## -import web.common.http +try: + # embedded + import openerp.addons.web.common.http as openerpweb +except ImportError: + # standalone + import web.common.http as openerpweb + import base64 import urllib2 -class Binary(web.common.http.Controller): +class Binary(openerpweb.Controller): _cp_path = "/web_linkedin/binary" - @web.common.http.jsonrequest + @openerpweb.jsonrequest def url2binary(self, req,url): bfile = urllib2.urlopen(url) return base64.b64encode(bfile.read())