diff options
| author | Vo Minh Thu <vmt@openerp.com> | 2012-08-09 14:15:37 +0200 |
|---|---|---|
| committer | Vo Minh Thu <vmt@openerp.com> | 2012-08-09 14:15:37 +0200 |
| commit | e8457bd914fb7482dad0bb529f99a34f5b2b1dd8 (patch) | |
| tree | 0a62b8ce313227766d35a72f79f4814838d0c469 /addons/web_linkedin/web_linkedin.py | |
| parent | af32150ad80fe29e1df7e252bc3d2b2e10d50f33 (diff) | |
[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
Diffstat (limited to 'addons/web_linkedin/web_linkedin.py')
| -rw-r--r-- | addons/web_linkedin/web_linkedin.py | 12 |
1 files 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()) |
